summaryrefslogtreecommitdiffstats
path: root/movement
diff options
context:
space:
mode:
authorJames Haggerty <james@gruemail.com>2022-10-12 13:35:08 +1100
committerJames Haggerty <james@gruemail.com>2022-10-12 13:35:08 +1100
commit79ff361f06e0693114a33d1613feb81d4c2ff624 (patch)
tree026e106a85d417a9ec80fe0a9827ee78a5479433 /movement
parent95f2f25ee68d2c7bd1f55f74d425153a9aa4d36d (diff)
downloadSensor-Watch-79ff361f06e0693114a33d1613feb81d4c2ff624.tar.gz
Sensor-Watch-79ff361f06e0693114a33d1613feb81d4c2ff624.tar.bz2
Sensor-Watch-79ff361f06e0693114a33d1613feb81d4c2ff624.zip
Make long press mode go back to face 0 instead of next face
Diffstat (limited to 'movement')
-rw-r--r--movement/movement.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/movement/movement.c b/movement/movement.c
index d79142ec..3d8fac01 100644
--- a/movement/movement.c
+++ b/movement/movement.c
@@ -407,9 +407,14 @@ bool app_loop(void) {
if (event.event_type) {
event.subsecond = movement_state.subsecond;
can_sleep = watch_faces[movement_state.current_watch_face].loop(event, &movement_state.settings, watch_face_contexts[movement_state.current_watch_face]);
- // escape hatch: a watch face may not resign on EVENT_MODE_BUTTON_DOWN. In that case, a long press of MODE should let them out.
- if (event.event_type == EVENT_MODE_LONG_PRESS) {
- movement_move_to_next_face();
+
+ // Long-pressing MODE brings one back to the first face, provided that the watch face hasn't decided to send them elsewhere
+ // (and we're not currently on the first face).
+ // Note that it's the face's responsibility to provide some way to get to the next face, so if EVENT_MODE_BUTTON_* is
+ // used for face functionality EVENT_MODE_LONG_PRESS should probably be handled and next_face() triggered in the face
+ // (which would effectively disable the normal 'long press to face 0' behaviour).
+ if (event.event_type == EVENT_MODE_LONG_PRESS && movement_state.current_watch_face > 0 && movement_state.current_watch_face == movement_state.next_watch_face) {
+ movement_move_to_face(0);
can_sleep = false;
}
event.event_type = EVENT_NONE;