Can we simulate the stop of pressing a key when it is pressed, for example a key is maintained after 2 seconds I want it to turn off even if the key is still pressed...
Develop games in your browser. Powerful, performant & highly capable.
You have to create a variable counting the seconds, or a timer.
If pressing key "X" --If CountSec <= 2. ---->Add CountSec to dt ---->"Do any Action you need to do" If not pressing any key -->Set CountSec to 0.