OnNextPage behaviour Map to KEY_UP?

According to the API - https://developer.garmin.com/downloads/connect-iq/monkey-c/doc/Toybox/WatchUi/BehaviorDelegate.html

onNextPage is supposed to map to KEY_UP but when I test and compile the app between a Physical Button Watch UP button vs a Vivoactive3 (on the simulator) the onNextPage seems like it's mapping to KEY_DOWN.

Is this the supposed behaviour or I am doing something wrong?

  • It isn't clear exactly what you're trying to say, but the vivoactive3 shouldn't generate KEY_UP or KEY_DOWN events at all.

    The content of devices.xml indicate that a swipe up (drag from bottom of screen toward top) should map to onNextPage for the vivoactive3.

    <behaviors>
    <behavior gesture="SWIPE_RIGHT" id="ON_BACK" />
    <behavior gesture="SWIPE_LEFT" />
    <behavior gesture="SWIPE_UP" id="NEXT_PAGE" />
    <behavior gesture="SWIPE_DOWN" id="PREVIOUS_PAGE" />
    <behavior gesture="HOLD" id="ON_MENU" />
    <behavior gesture="RELEASE" />
    <behavior gesture="TAP" id="ON_SELECT" />
    </behaviors>


    In most cases, a behavior that is associated with a KEY_UP event on a button-based device would be associated with a SWIPE_DOWN on a touch-based device.

    The documentation states that typically the UP button or a swipe up would get you an onNextPage event.. This is not actually true. There are devices that generate this event with a KEY_DOWN (d2_bravo, d2_charlie, edge130, edge520, epix, fenix3, fenix5, fenix5+, fr645, vivoactive3, vivoactive_hr), SWIPE_UP (epix), SWIPE_LEFT (approach_s60, edge1030, edge1000, edge820, fr630, oregon, rhino, vivoactive), but none that map it to KEY_UP.

    If anything, it seems like you're trying to point out a documentation issue here. Maybe the documentation for onNextPage() and onPreviousPage() should not indicate KEY_UP/SWIPE_UP and KEY_DOWN/SWIPE_DOWN result in the same action?

    Travis
  • Given that data I gathered for the above post, I went ahead and made a change to the docs for onNextPage() and onPreviousPage().
  • I think there's possibly just a confusion issue in terms of comprehension. When I read the documentation, I was expecting that the functionality would be the same in terms of behaviour.

    onNextPage == KEY_UP event
    hence, when I trigger onNextPage

    1) on a physical button watch - UP KEY works as expected
    2) on a touch screen watch (Vivoactive3) - it turns out as a SWIPE DOWN (Documentation says should be SWIPE UP)

    he documentation states that typically the UP button or a swipe up would get you an onNextPage event.. This is not actually true. There are devices that generate this event with a KEY_DOWN (d2_bravo, d2_charlie, edge130, edge520, epix, fenix3, fenix5, fenix5+, fr645, vivoactive3, vivoactive_hr), SWIPE_UP (epix), SWIPE_LEFT (approach_s60, edge1030, edge1000, edge820, fr630, oregon, rhino, vivoactive), but none that map it to KEY_UP.



    That's the confusion. and I guess I'm also confused by your statement above. The fenix 3 and fenix 5xplus both maps onNextPage to the KEY_UP (physical up button)
  • Regardless of device or configuration, a down button press and an upward swipe represent the same input request... the user wants to see what is 'below' what is currently on the screen.

    As I said above, I've updated the documentation to reflect this. It now says this about onNextPage:

    This is typically triggered by the down button (KEY_DOWN) or by a SWIPE_UP SwipeEvent on a touch screen.


    The fenix 3 and fenix 5xplus both maps onNextPage to the KEY_UP (physical up button)


    I've checked the device configurations in the simulator and run the Input sample on a 5x+; pressing the down key on the device results in a NEXT_PAGE behavior and a KEY_DOWN input event. This is the opposite of what you are reporting.

  • I have this code to handle the Button Presses..

    function onPreviousPage() {
    Sys.println("\n11 KEY_UP/ononPreviousPage AppFunction:");
    return true;
    }

    }

    Documentation says :
    This is typically triggered by the down button (KEY_DOWN) or by a SWIPE_DOWN SwipeEvent on a touch screen.

    On F5x+:
    Press the Physical UP Key triggers the OnPrevPage

    on the Vivoactive3
    Slide DOWN (finger from top of watch to bottom of watch) triggers the OnNextPage

    Is this the supposed function? Seems like it's mapping differently to the documentation or perhaps I am just not understanding the english or as you mentioned - some watches handles it differently?
  • First off, the documentation qualifies the claim about which inputs do what with the word typically... i.e., not all devices follow the documented convention.

    Second, as I've said several times above, the documentation you are referring to is currently wrong. I have made the appropriate fix, but it won't go out until the next 3.0.x release. Here is the new text (emphasis added)

    onNextPage => Toybox.Lang.Boolean
    Represents the Next Page behavior.

    This is typically triggered by the down button (KEY_DOWN) or by a SWIPE_UP SwipeEvent on a touch screen.


    onPreviousPage => Toybox.Lang.Boolean
    Represents the Previous Page behavior.

    This is typically triggered by the up button (KEY_UP) or by a SWIPE_DOWN SwipeEvent on a touch screen.
  • Got it .. thanks.. KEY_UP and SWIPE_DOWN..
    just wanna ensure that user experience is similar to native garmin apps.