Vivoactive 3: KEY_ENTER not detected?

EDIT: I guess this is not a bug. I guess VA3 widgets just can't use the physical KEY.

My mistake.

---

Connect IQ SDK 3.6

Some users my Stop and Go stopwatch widget are reporting that pressing the KEY does not work. Instead of starting the stopwatch, it only returns them to the watchface.
https://apps.garmin.com/en-US/apps/3...0-a7dc7bdc72b8

The way it's supposed to work is:
- If you press the key on the widget "home page":
-- If the timer is reset, the widget is entered and the stopwatch starts
-- If the timer is running/stopped, the widget is entered

- If you press the key when already in the widget, the stopwatch state is toggled between started/stopped.

This works fine for me in the simulator and on a real 935. Two VA3 users have complained about being unable to start the stopwatch. Another VA3 user says that it works just fine.

Couple of wrinkles:
- I have code to detect long presses. Long press of start does something on platforms where this is not taken up by some other function. I realize that onKeyPressed/onKeyReleased are not supported on every platform, but I have fallback code in onKey() which checks to see if onKeyPressed was previously called for that key. I guess the only way this could fail is if onKeyPressed is called, but onKeyReleased never is, in which case I would have to skip that logic for VA3.

- I have already implemented a workaround based on a VA3 issue that was reported last year:

private function getKey(keyEvent)
{
var k = keyEvent.getKey();
if (sVivoactive3)
{
if (k == 45 || k == 47 || k == 49)
{
k = WatchUi.KEY_ENTER;
}
}
return k;
}


Reading through the forums, I see these related issues:
https://forums.garmin.com/forum/deve...ansferred-code
https://forums.garmin.com/forum/deve...-on-the-device
  • Former Member
    Former Member over 6 years ago
    I'm having a similar problem. I VA3 user is saying Enter (tap right-side of screen) is not working on one of my apps, when it is in the simulator. I'm using the standard picker code from previous 2.x SDKs. I am not using the very latest SDK as previously one had a bug where the Up key no longer worked in the simulator, so I went back a couple of versions.

    Is there a compete SDK changelog somewhere the lists all the versions and what has been fixed?
  • Former Member
    Former Member over 6 years ago
    Update. Same problem exists on latest SDK, picker code doesn't work on VA3. :-(
  • grolschie Regarding your 12/26 post for SDK changelog, If you look in your SDK folder, the README.html contains a list of changes made for each SDK release.
  • Stephen.ConnectIQ So what I'm gathering from reading the manual and talking to users is that the VA3 KEY will always return the user to the watchface, except when in an activity (or app). Could you please confirm this?

    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.

    During an activity, press to pause the activity.



    I mentioned this elsewhere, but I really wish the simulator would emulate this kind of device-specific behaviour where the devices traps a key in a way that can't be overriden, instead of pretending that it will work.

    I also wish that this kind of thing were explicitly documented. I mean, in this case a "device app" is equivalent to an activity, but a widget is not. Sure, that makes sense, but should I have assumed that?

    Hopefully I haven't missed that somewhere.
  • Some of it is probably in the UX guide (I admit, I'm really not looked at it in a long time!), And some things you can code differently based on what you need.

    For example, consider a widget, but you want to use the up/down buttons in it on a 935. With a single view, up/down moves you through the widget loop. But, if you push a second view, it will have its own delegate, and you can access up/down and do what you want in that view.

    It's not a definite that in a widget, back takes you to the watch face. With multiple views, it can take you back to the main or last view, for example.
  • jim_m_58 to clarify, I am not talking about Back. I am talking about the VA3 KEY always taking users back to the watchface (unless in an activity), which is not overridable by widgets, apparently.

    This is my new understanding based on reading the manual and talking to users. I hope someone can correct me if this is wrong. But otherwise I don't know how to explain why my stopwatch widget can't use the VA3 KEY to start/stop the timer.

    Thank you for the advice tho. (Yes, I understand the concept of initial view versus a secondary view, in widgets, and have implemented that in my widget.)
  • The same probably apples to that key. Can you catch it in your second view? Catch onSeleect() which is a tap?
  • jim_m_58 that's my point, I can't catch KEY at all in a VA3 widget (whether long or short press), and I wish there was some way of knowing that a priori.

    Yes I can catch taps, but I wanted a stopwatch widget which behaves like an app:
    - KEY to start/stop
    - Double tap to lap

    Now I changed it to:
    - Tap to start/stop
    - Swipe right to lap

    It's fine, but the controls for my stopwatch app and stopwatch widget are different now, for VA3 users.

    I guess it's not the end of the world. Not like there's a ton of users anyway.

    Thanks!

    It's my fault for not listening when ppl kept telling me that "pressing KEY takes me back to the watchface". But if only the sim could model that behaviour....
  • I did throw together a simple widget, and the button can't be caught even in the second view on a va3, so what you're doing the the best way. The va3 is an odd device for input - with only one button.
  • jim_m_58 thank you very much for testing that.

    Now my question for Garmin is, as a developer, how do I know that for sure unless:
    - I ask someone
    - I own a VA3
    - Or I release a broken widget to the store and ppl complain?

    If this is explicitly written down somewhere, then I take it all back.

    As it is, the closest I can see is the manual, where it says that KEY returns you to the watchface, except when you are in an activity.

    For CIQ devs, this translates as: Apps can use the KEY, but widgets can't.

    I'll just say I really, really, really wish the simulator would emulate the behaviour of all these reserved keys that apps/widgets can never, ever trap, since every family of devices is different. Even if it just means ignoring the key and logging something to the console.