Clock setup when pressing up + down in sequence
jtomasrl opened this issue · 6 comments
When pressing Up, releasing and immediately pressing down, the Clock setup menu is displayed (v1.5.1). Same happen if pressing Down first and then Up.
Correct. Is this undesirable to you?
The code detects double-clicks on the Select buttons and toggles Clock Setup when the 2nd click is not the same button as the 1st click. So the actual gesture is "press both buttons in quick succession" which also covers "simultaneously"
I like this because it means you can still get to the clock screen with one finger... when the cables are in the way 😉
I could potentially make the double-click time shorter so this is harder to stumble upon accidentally... which would also affect the applet help screen function.
When navigating through menus with +- navigation, it can get quite tricky. Maybe the Hemisphere config should be a menu entry (in the apps menu) instead of overwriting its default behavior (clock setup)
I think this was an expected behavior. Anyways I made a change in my code, I'll leave it here is someone else wants to change the default behaviour:
HemisphereApplet.h
, add
#define HEMISPHERE_SIM_CLICK_TIME 1000
Then, in APP_HEMISPHERE.ino
, inside DelegateSelectButtonPush
function, after if (down)
section, change
if (OC::CORE::ticks - click_tick < HEMISPHERE_DOUBLE_CLICK_TIME) {
// This is a double-click. Activate corresponding help screen or Clock Setup
if (hemisphere == first_click)
SetHelpScreen(hemisphere);
else // up + down simultaneous
clock_setup = 1;
// leave Select Mode, and reset the double-click timer
select_mode = -1;
click_tick = 0;
}
With
if (OC::CORE::ticks - click_tick < HEMISPHERE_SIM_CLICK_TIME) {
clock_setup = 1;
click_tick = 0;
} else if (OC::CORE::ticks - click_tick < HEMISPHERE_DOUBLE_CLICK_TIME) {
// This is a double-click. Activate corresponding help screen or Clock Setup
if (hemisphere == first_click)
SetHelpScreen(hemisphere);
// leave Select Mode, and reset the double-click timer
select_mode = -1;
click_tick = 0;
}
This will add a second Click timer, for simultaneous click, so it will simulate a simultaneous click on Up and Down
I actually quite like this solution! I'll try it out, see how it feels.