Documentation Request - Device Button Behaviour

Hi,

Could I make a documentation request? I can't find anything in the Compatible Devices section or the User Experience section, and I am struggling!

It would be good to see what different devices call on the events used in BehaviorDelegate (and InputDelegate) when different interactions are done.

For example
onSelect onMenu onNextMode etc
Epix Enter/Touchscreen
920XT
Vivoactive
etc

This would be very helpful for multi-device apps, as I am struggling to work out which devices call which events on which buttons!!

Thanks
Chris
  • Former Member
    Former Member over 8 years ago
    function onKey(evt) {
    if(evt.getKey()==Ui.KEY_ENTER || evt.getKey()==Ui.KEY_START) {



    Thank you .. :)

    EDIT .. I have gone back to onMenu as my onBack does not work now. I tried to map that like above .. but cannot find anything that works. In the simulator my app does not close like it did before.

    Found it .. KEY_LEFT_DOWN
  • Try running the "input" sample from the SDK on the watch, as that shows all the input you can get.

    What kind of a delegate do you have? And maybe you are returning "true" on something you shouldn't..

    The code I posted for KEY_START and KEY_ENTER works in a BehaviorDelegate for sure...

    KEY_START has always worked for the va and 23x devices, but at least early on, the 630 set KEY_ENTER, which is why I check for both.

    Also, the onBack() code can get a bit interesting in recording apps. In general usage, "back" is also the lap button in apps. So before recording, back should exit the app. While recording, it could do things like addLap() or just return "true", and after session.save()/session.discard(), it's back to exiting the app, for example.

    Some things like this are best seen on the watch and not in the sim...
  • Former Member
    Former Member over 8 years ago
    Try running the "input" sample from the SDK on the watch, as that shows all the input you can get.

    What kind of a delegate do you have? And maybe you are returning "true" on something you shouldn't..

    The code I posted for KEY_START and KEY_ENTER works in a BehaviorDelegate.

    KEY_START has always worked for the va and 23x devices, but at least early on, the 630 set KEY_ENTER, which is why I check for both.


    It is working perfectly .. I just did not know the key code for the left button. But it was LEFT_BUTTON_DOWN. Your code worked fine as I knew it would. ;-) I also fixed my big memory hog, got rid of a bitmap and down to 1/3 the memory. Tonight .. test walk. As long as that goes well .. then it will be adding the rest.
  • It is working perfectly .. I just did not know the key code for the left button. But it was LEFT_BUTTON_DOWN. Your code worked fine as I knew it would. ;-) I also fixed my big memory hog, got rid of a bitmap and down to 1/3 the memory. Tonight .. test walk. As long as that goes well .. then it will be adding the rest.


    I still cant see why you are looking for LEFT_BUTTON_DOWN at all. There's something odd in your delegate, IMHO....
  • Former Member
    Former Member over 8 years ago
    I still cant see why you are looking for LEFT_BUTTON_DOWN at all. There's something odd in your delegate, IMHO....


    KEY_DOWN_LEFT works. I was using onBack but that stopped working once I added the onKey. I just added the KEY_DOWN_LEFT in the same way as the KEY_START etc.
  • KEY_DOWN_LEFT works. I was using onBack but that stopped working once I added the onKey. I just added the KEY_DOWN_LEFT in the same way as the KEY_START etc.


    Sounds like in your delegate you might always be returning "true" from onKey(), instead of just returning "true" for keys you handle... Like your onKey() says it handled keys it didn't so onBack() was never called... True and false are your friend in delegates! :)