Acknowledged
CIQQA-3113

bug: swipe right on the left side of the screen triggers onKey(KEY_ESC)

I noticed this with my app in simulator (fr955, SDK 8.1.1), and then I checked it with the Input sample and it also reproduces it, so it's clearly a bug both in the simulator and even on real devices (tested on real fr965). A similar bug was already reported 4 years ago: https://forums.garmin.com/developer/connect-iq/i/bug-reports/vivoactive-4s-swipe-identified-as-a-key-pressed

To reproduce:

- run the Input sample from the SDK on fr955 in the simulator.

- swipe right in a way that you touch in the middle or the right side of the screen => correctly, only swipe event is triggered

- swipe right touching in the left side of the screen => onKey(KEY_ESC) is triggered (It's not clear when this happens, in the Input sample it looks like sometimes this only happens every 2nd time you swipe on the left side of the screen)

  • Here's a rewrite of my previous comment that's a bit more structured, with one additional observation relating to Menu2.

    Observations relating to this bug report:

    1a) (simulated fr955) swipe right from left side of screen triggers KEY_ESC (bad), but only sometimes (even worse). Swipe right from anywhere else on the screen does not trigger KEY_ESC (good)

    1b) (real fr955) same as 1a), except swipe right from left side always triggers KEY_ESC (bad)

    2) (real or simulated fr955) swipe right from left side triggers onBack() (good). swipe right from elsewhere triggers onBack() (bad)

    3) real fr955: Menu2InputDelegate triggers onBack for a swipe right from left side, but *not* for a swipe right from elsewhere (good). This is good but it's further proof that 2) is inconsistent and wrong.

    How this is different from native behaviour:

    - in the built-in UI, swiping right from anywhere but the left side never triggers the "go back" action. to go back, you have swipe from the left side. (sometimes even this gesture is disabled - e.g. on the map page.)

    - in the built-in UI, swiping right from anywhere but the left side either does nothing or pans a map / chart

    Consequences for CIQ apps:

    - If CIQ apps use onBack() to go back (as they normally would/should), then they will not be able to distinguish the two kinds of right swipes (as the native UI can), and they will act differently than the native UI for the right swipe from anywhere but left side

    - if CIQ apps want to act like the native UI, they have to use KEY_ESC to go back, and explicitly prevent onBack() from going back

    - if CIQ apps use the default behaviour for onBack(), they will inherit this bad behaviour (I can already see this with a random device app I've installed from the store)

    - For CIQ apps which inherit this bad behaviour (which will be most or all of them), if they use Menu2, then the behaviour of right swipes will be inconsistent within the parts of the app that use Menu2 and everywhere else in the app

  • Great find!

    I tested with the Input sample on a simulated fr955 and found the same thing as you did.

    Furthermore, on a real fr955, this happens consistently.

    Any swipe right starting from the left side will trigger KEY_ESC and onBack(). (On a real device, you can see both events being triggered, as the display update is fairly slow.)

    I also found that on both a simulated and real fr955, a right swipe which does not start from the left side of the screen correctly triggers onSwipe(RIGHT_SWIPE), but also incorrectly triggers onBack(). This is wrong because on real fr955, a right swipe gesture only triggers the "go back" action when it starts from the left side of screen. On most built-screens, a right-swipe that doesn't start from the left side does nothing; in other cases it pans a glance chart or the map screen.

    So clearly the built-in UI is available to distinguish between:

    1) right swipe starting from left side of screen, which should trigger onSwipe(RIGHT_SWIPE) and onBack() (or their native equivalents)

    and

    2) right swipe not starting from left side of screen, which should trigger onSwipe(RIGHT_SWIPE) and not onBack()

    But in the sim (fr955) both of those gestures trigger onBack(), but only 1) triggers KEY_ESC (only sometimes).

    On a real device (fr955) both of those gestures trigger onBack(), but only 1) triggers KEY_ESC all the time.

    To me is a huge mess because:

    - it violates an unspoken assumption that a touch gesture shouldn't be registered as a key. (Isn't that why the Input sample uses the first status line for "actions", which either keys or touch gestures?) But only the right swipe gesture registers as a key. For example, a tap doesn't register as KEY_ENTER.

    - it means that if your app to follow the native behaviour where swiping right from the left side (usually) goes back, but swiping right from anywhere else on the screen *never* goes back, it should pop the current view on  KEY_ESC and but *not* onBack(). It also means that if your app does not override onBack(), it will inherit the same bad behaviour where right swiping from the middle of the screen will pop the view / close the app. I can actually see this bad behaviour with a random device app that I installed from the store.