VA-3 unexpected button behaviour

I appear to have a behaviour from the button on a VA-3 which is unexpectedly closing my app.
I don't have a device to test on so am relying on a report from one of my users.

The app is coded to respond to the button press on the Start Timer screen by starting the timer countdown, as shown in the sim video (https://youtu.be/Er_IZBE-_TI).

On the device, when he presses the button, from the Start Timer view, the app closes.( https://youtu.be/1wGIPG1kjHE)

However, when he navigates back to the Start Timer view via the Perfect Start view, the button press correctly starts the countdown timer.(https://youtu.be/uv1qc23mpT8)

I am capturing the button press in the behaviorDelegate with:
function onKey(evt) {
var key = evt.getKey();
if (key == KEY_ENTER) {
emulateOnSelect(); // VAHR, VA-3 Select key don't raise behavior onSelect
}
}


It appears from the video and his commentary, that this is not being triggered on the initial display of the view, but is being triggered on subsequent displays.


As I say, I am unable to replicate this as I don't have a device.

(The forum won't permit me to add three links)

[EDIT]
This code is being correctly interpreted on my VA-HR device and doesn't misbehave like reported on the VA-3

  • In your onKey() function, you want to generally return "true". If you don't do that, the va3 can do things like you see,
  • Can you explain this please?
    Is it just a peculiarity of the VA3?
  • Returning true in a behaviour/input delegate means that you have handled the input. No further related input delegates will be called and the default behaviour will be suppressed.

    Some notes:
    - As others have pointed out, VA3 is a bit stricter than other devices regarding the return value of input delegates
    - On VA3, the default behaviour for the KEY (KEY_ENTER) is to return to the watchface, unless you are in an activity (according to the manual). This could explain the behaviour the user is seeing, if CIQ expects device apps to explicitly handle KEY_ENTER by returning true. Sadly, as we all know, this is neither explicitly documented anywhere nor emulated in the sim
    - There’s no other watch that has the same kind of weird default behaviour for KEY_ENTER. VA3 is the only watch with just one physical button
    - on VA3, widgets cannot handle KEY_ENTER, period. It always takes the user back to the watchface (closing the widget)
    - There’s lots of inputs the sim will happily pass to your app, but can’t be caught on the real device, like holding either button on the VAHR, since those are mapped to functions that can’t be disabled. Another example is hold Light or hold Up on current 5-button watches (controls menu and settings menu, respectively)
    - Sometimes you don’t want to return true in a behaviour delegate. This is typically when you intend on handling the corresponding key or swipe explicitly, in an input delegate. For example if you return true in onBack, you’ll never see the corresponding swipe or key event if you wanted to handle them separately. (The behaviour delegate is called first, followed by the input delegate(s))

    To be fair, the docs do say to return true if the input is handled.
  • Thanks guys, the return true fixed the issue.

    But it's not really a question of the va3 being stricter.
    We are told to return true to indicate that the event has been handled, but since there's no other behaviour associated with the enter key, that instruction seems irrelevant!

    Ho Hum, another three hours that I'll never have again.
  • The basic rule is ALWAYS return true or false from an input delegate. The nice thing is when you add that, it doesn't break things on other devices. The va3 is unique, and it seems to be the one button thing where the same button is used for different things based on the app type.
  • RaceQs Yes, I agree the "VA3 being stricter" is sort of a red herring, but I'm only repeating what has been said before. I think a better explanation is different KEY_ENTER behaviour for VA3.

    As I mentioned, for VA3 only, the "KEY" is supposed to return you to the watchface unless you are in an activity. This is according to the user manual.

    It literally says:
    https://www8.garmin.com/manuals/webh...C4D8A7607.html
    Key
    Hold to turn on the device.

    Hold to view the controls menu, including device power.

    Press to return to the watch face from any screen, except during an activity.


    What's unclear to me is what is supposed to happen when you are in a CIQ device app (which is similar to an activity, but is it the same?). Clearly device apps are able to handle KEY_ENTER on VA3, but it isn't clear what's supposed to happen when KEY_ENTER is not handled.

    If only it was documented or emulated in the sim. Then we would know if what your user is seeing is a bug or intended behaviour.

    Either way, I think it's pretty clear that the current implementation is:
    - For VA3 device apps, if KEY_ENTER is not handled by the app, the app closes when you press it. (Either that, or the current view is popped -- the former is more likely though, imo.)

    However, I do think it is a good idea to follow any instructions that are explicitly (or even implicitly) laid out in the docs. Ignoring them may be okay today, but not tomorrow.

    You may wish to file a bug report in any case. Device apps usually act just like activities in most cases, so this seems like it could be a bug.