Skip to content

Commit

Permalink
Allow configuring mode long-press behaviour.
Browse files Browse the repository at this point in the history
  • Loading branch information
WesleyAC committed Nov 3, 2023
1 parent fa13f01 commit 1428cf3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
13 changes: 10 additions & 3 deletions movement/movement.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,16 @@ bool movement_default_loop_handler(movement_event_t event, movement_settings_t *
break;
case EVENT_MODE_LONG_PRESS:
for (uint32_t i = 0; i < MOVEMENT_NUM_PAGES; i++) {
if (movement_state.current_watch_face == movement_pages[i]) {
movement_move_to_face(movement_pages[(i + 1) % MOVEMENT_NUM_PAGES]);
return true;
if (MOVEMENT_MODE_LONGPRESS_ALWAYS_NEXT_PAGE) {
if (movement_state.current_watch_face > movement_pages[i] && movement_state.current_watch_face < movement_pages[(i + 1) % MOVEMENT_NUM_PAGES]) {
movement_move_to_face(movement_pages[(i + 1) % MOVEMENT_NUM_PAGES]);
return true;
}
} else {
if (movement_state.current_watch_face == movement_pages[i]) {
movement_move_to_face(movement_pages[(i + 1) % MOVEMENT_NUM_PAGES]);
return true;
}
}
}

Expand Down
7 changes: 7 additions & 0 deletions movement/movement_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,13 @@ const uint8_t movement_pages[] = { 0, MOVEMENT_NUM_FACES - 2 };

#define MOVEMENT_HIDDEN_FACES_INDEX MOVEMENT_NUM_FACES - 2

/* Setting this to true will make a long-press of the mode button always jump
* to the next page, instead of the default behaviour, which is only jumping to
* the next page if you are on the first face of a page. This is likely most
* useful if you have a large number of faces, but it has the downside that it
* can make returning to the first face more difficult. */
#define MOVEMENT_MODE_LONGPRESS_ALWAYS_NEXT_PAGE false

/* Custom hourly chime tune. Check movement_custom_signal_tunes.h for options */
#define SIGNAL_TUNE_DEFAULT

Expand Down

0 comments on commit 1428cf3

Please sign in to comment.