hd-zero / hdzero-goggle

MIT License
263 stars 76 forks source link

Make button and roller actions configurable for video mode #367

Closed Master92 closed 12 months ago

Master92 commented 1 year ago

This adds a page in the settings where one can freely assign the actions that are executed when a button or the roller is operated in video mode. I also added the ability to change the top fan speed and the OLED brightness level with the roller.

When changing a channel is requested, the left short button acts as the "Enter" button, regardless of which action is configured for it.

Note: This changes the behavior introduced with #348 where I double-assigned the double right click for either HT Center or Go Sleep! mode. However, as this PR is not yet in the release candidate, I think, this shouldn't do much harm. Closes #357

The available actions are for the roller:

and for the buttons:

Setting

Roller

Button

SumolX commented 1 year ago

Very nice! I was working on a similar approach.... function pointers and all. Excellent work!!

MrMap commented 1 year ago

The functions of this PR is brilliant and very welcome for several reasons. As a Head Track user I greatly appreciate the HT Center and HT Calibrate - well done.

I just got to think about an additional HT option for configurable button assignment: HT on/off. Today I use INAV logical programming to achieve the same (which also needs one radio channel). I think there might be multiple situations where the HT user would benefit from easily toggling HT on/off easily on the goggles.

Master92 commented 1 year ago

I just got to think about an additional HT option for configurable button assignment: HT on/off.

Good idea. I think, some feedback in the OSD would be needed as well wouldn't it? Simply toggling would be easy but without any feedback it could be pretty hard to guess what's happening.

MrMap commented 1 year ago

I just got to think about an additional HT option for configurable button assignment: HT on/off.

Good idea. I think, some feedback in the OSD would be needed as well wouldn't it? Simply toggling would be easy but without any feedback it could be pretty hard to guess what's happening.

Quite right! Feedback is desirable. This also applies for HT calibration; let it beep while calibration in progress (meaning don't move goggles until calibration complete).

ligenxxxx commented 1 year ago

This branch has conflicts that must be resolved.

Master92 commented 1 year ago

Rebased onto current main.

evilC commented 11 months ago

[EDIT] Sorry, I just realized. I was testing on the bench using HDMI out - so clearly this PR only turns the goggles screen off, it does not stop the HDMI feed (Which just gets frozen on the last image).

I just flashed this today, and Go Sleep does not seem to work. To be clear, I actually flashed this PR because I wanted both of these things - so conceivably it may have crept in as part of that. When in the main menu, Go Sleep seems to do absolutely nothing. If I configure LP of right button as a shortcut for Go Sleep, and then activate it while on the FPV view (But with no connection currently active - ie quad is off), then the following happens:

  1. Screen off for a second or 2
  2. Screen on and VERY brief loading bar
  3. Screen off for about a second
  4. Screen on, back to normal
Master92 commented 11 months ago

Huh, that seems strange. To be fair, I never used HDMI out, yet. Therefore I don't know what the behavior is or was supposed to be.

By saying you wanted to enter sleep mode from the main menu you mean via the lowermost menu entry, right? Because shortcuts and button actions only work in video mode.

Can you confirm that the behavior is similar with a previous release version? If that's the case, please open a new issue. This PR didn't actually change any code related to sleep mode, therefore I can only imagine it being an already existing issue. The only time I touched sleep code was in #348 while I extracted it from one place to another.

evilC commented 11 months ago

That was a complete red herring... Of course, when in the menu, if you activate sleep, and you are on HDMI (Which does not disable during Go Sleep), then "Nothing happens" is how it is going to be perceived I never used Go Sleep before, so I cannot comment on whether it changed. TLDR - nothing to do I don't think. As soon as I realized that sleep mode does not stop feeding HDMI, all the observed behaviour makes complete sense.

pitts-mo commented 11 months ago

Hello @Master92 Are you able to make the input page display the current settings on fresh power up?

I have been running this from the SD card for about a week and find this a very helpful feature. The only concerning observation I have so far is that on fresh boot the button options within the input menu appear to show default settings. However, testing the functions after a power cycle does show my button preferences set during the last power session were saved correctly. Additionally, if I adjust settings my preference is again preserved/displayed within the input menu for the remainder of the power session.

Master92 commented 11 months ago

Ooff, I thought I already did that. So you're saying, everytime you power up, the settings page displays the defaults instead of the current settings but the button actions act as they were configured in the previous session?

I am currently unable to test that but if you can safely verify that that's the case, please open an issue and tag me so we can easier track what's going on.

Happy new year btw. 🎉😃🚀