Download

hold input event

Hi, I think that there should be a hold input event similar to the hold key event, but for a customizable input event. If the input is held for X amount of second it gives one output and if the input is released before then, it executes another output. This world be helpful for example fighting games where the Player wants to be able to execute heavy and light attack.

Kurtaa1: you can do that yourself now pretty easily: the events give you both an up and a down version, so you can look at the timer yourself to decide for how long it’s been pressed. I.e, remember the time on the down event, and subtract the current time from that to decide how long it’s been held. I do something like that now to distinguish double-clicking from single clicking, but you could just as well use it to determine length of time a key was held.

Alternatively, on pressed event - create a timer that calls a function after your hold interval. The function could then do whatever you you want to happen on a hold :slight_smile: Remember clear the timer on button release if it’s still running, i.e. wasn’t held long enough :wink:

rOb