]> git.earman.xyz Git - sensor-watch.git/commitdiff
handle switch to secondary face in default handler
authorjoeycastillo <joeycastillo@utexas.edu>
Sun, 15 Jan 2023 15:28:41 +0000 (09:28 -0600)
committerjoeycastillo <joeycastillo@utexas.edu>
Sun, 15 Jan 2023 15:28:41 +0000 (09:28 -0600)
movement/movement.c

index 05da1800516401fbc5f6f5d0a5557464d0c675f0..1a646e2555d774edafd4b860a87f429c2f403c02 100644 (file)
@@ -229,7 +229,11 @@ bool movement_default_loop_handler(movement_event_t event, movement_settings_t *
             movement_illuminate_led();
             break;
         case EVENT_MODE_LONG_PRESS:
-            movement_move_to_face(0);
+            if (MOVEMENT_SECONDARY_FACE_INDEX && movement_state.current_watch_face == 0) {
+                movement_move_to_face(MOVEMENT_SECONDARY_FACE_INDEX);
+            } else {
+                movement_move_to_face(0);
+            }
             break;
         default:
             break;
@@ -468,20 +472,6 @@ 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]);
-
-        // 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). If we're currently on the first face, a long press
-        // of MODE sends us to the secondary faces (if defined).
-        // 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.watch_face_changed) {
-            if (MOVEMENT_SECONDARY_FACE_INDEX && movement_state.current_watch_face == 0) {
-                movement_move_to_face(MOVEMENT_SECONDARY_FACE_INDEX);
-            }
-        }
-        event.event_type = EVENT_NONE;
     }
 
     // if we have timed out of our timeout countdown, give the app a hint that they can resign.