Do action when the back key or down is long press

I want to do an action when I hold the back key or the down one for at least 3 sec

  • Well, this event is not defined by default, so if you want it, you have to implement it.

    The main problem is that, with new devices you can set shortcuts and a shorcut in a long press to button 'laps/down/enter...

    So if the user still has a shortcut on the 'back' key, it will be priority to your event.

  • Simple answer is that you don't want to do this, as it could act very differently on different devices.  Consider the va3 that doesn't even have a back button.  Hot keys are another case, The va4/venu/venu sq, a long hold of back is "menu", etc,

    Stick with defined key presses as stated in the UX guide,

  • Yeah, I tried to implement an app with long presses and I learned the hard way that it's not a good idea. Some old devices don't support long presses, and as others said, some devices have hot keys which will cause your own long-press logic to be skipped.

    I do have "long press" as an option in my app, but I have no idea how many people use it. I definitely wouldn't use long press by default for any action in an app.

  • Long press "up" is "menu" on many devices, long press "down" is music on some. Long press of start/enter is controls on some, etc.

  • Yes, I realize that. That's why I said:

    > I definitely wouldn't use long press by default for any action in an app.

    I have certain long-press shortcuts as an *option* for device where I know it doesn't conflict with system hotkeys. e.g. Long-press START or long-press BACK on modern 5-button watches. But they can still conflict with user-defined hotkeys, which is why I have them only as options.

    It's also worth nothing that the simulator often doesn't reflect this stuff. For example, the VA3 button will never be detected in a widget because the system action is to return you to the clock, but the simulator acts as if it would work. Same with the fact that certain devices just won't detect long presses no matter what iirc.