FR235 and menu key - button action fires both "menu" and "up" key events

Former Member
Former Member
Howdy,

I'm testing a watch app using API 1.3 for the FR235 (running v5.2 firmware) that has a menu and uses the up and down keys. On the FR235, pressing and holding UP key is the menu key. That works fine and onMenu is tripped in the BehaviorDelegate. Unfortunately, the onPreviousPage (UP key) is also fired before the on menu. So the app sees two events when the user is trying to get to the menu and this causes other problems (switching between modes in the watch app). I tried switching to the InputDelegate, but onKey is also getting both the UP button and the MENU button.

When testing in the simulator, it works correctly. But on the actual watch, not so much.

Code is simple and looks like:

function onMenu() {
Routines.getController().action_showMenu();
return true;
}

function onSelect() {
Routines.getController().action_advanceRoutine();
return true;
}

function onNextPage() {
Routines.getController().action_gotoNextRoutine();
return true;
}

function onPreviousPage() {
Routines.getController().action_gotoPrevRoutine();
return true;
}


Any ideas on how I can "detect" when onPreviousPage() is invoked that it's still held down and "on it's way" to being a MENU button and not actually do my onPreviousPage logic?

Gerry
  • I just recently noticed this when testing another developer's app with the fr735xt. I don't believe this issue has been brought up with the development team yet.

    That said, it seems to me the only way to handle it is to handle key events when the key is released or after a timeout. This might mean that your input delegate needs to keep track of the state of the key and maybe use a timer.

    Travis
  • Former Member
    Former Member over 8 years ago
    Check latest post in my topic for possible workaround. And take notice how long ago I did find it for the first time. No one reacted ever since so it seems we'll just have to live with that.
  • It's not just the 235, but also the 230 and 735.... (I've only tried with 1.3.x or 2.1.x VMs)

    I have an app where I just started using "menu", and another devleloper with a 735 noticed it over the weekend while testing something for me. The app is too big to run on a 230, so I put something smaller together so I could look into it on the 230 I have.. I tried various things, such as using KEY_UP/KEY_DOWN/KEY_MENU vs onMenu(), etc, and no difference...

    I suspect it's something in the firmware and not the VM itself though. I was planning to put something together to send off to garmin that demonstrates it, but haven't done it yet.

    Another thing I saw on the 230, is that's it's not consistent (I was thinking I'd just do my KEY_DOWN code if I got a KEY_MENU for these devices to counteract it).

    In my case, the side effect is that when the user leaves the menu, the screen has switched, and if it does, they just need to do a KEY_DOWN to change back. Using "menu" in the app won't be that common, so for now, I think I'll just go with that. For something that's not real common in my app, I think I'll skip looking for press/release and timers...
  • Former Member
    Former Member over 8 years ago
    That said, it seems to me the only way to handle it is to handle key events when the key is released or after a timeout. This might mean that your input delegate needs to keep track of the state of the key and maybe use a timer.


    Unfortunately, at least on the FR235, onKeyReleased doesn't work -- you can only get key presses. I found that out back when I was trying to implement a 'long press' behavior with InputDelegate. You get the press but not the release. I beleive somewhere in the forums I found a post saying this was known behavior (wasn't sure if it was considered a bug or a limitation of the device). But in short, I can't use onKeyRelease to work around this.

    Per the post referenced by jim_m_58, some sort of timer solution might be the only was and that's going to really ugly up the U/I experience.

    Is there some API that would let me at least "poll" the current state of a button? If might help in trying to determine pressed/released as part of the work around.

    Gerry
  • Is there some API that would let me at least "poll" the current state of a button? If might help in trying to determine pressed/released as part of the work around.


    That sucks. I don't remember that, but it does make those methods less than useful.

    As far as I know there is no way to poll the state of the keys, and without onKeyRelease() you can't even track the key states for yourself.