this post was submitted on 10 Jun 2024
17 points (94.7% liked)
Firefox
20363 readers
85 users here now
/c/firefox
A place to discuss the news and latest developments on the open-source browser Firefox.
Rules
1. Adhere to the instance rules
2. Be kind to one another
3. Communicate in a civil manner
Reporting
If you would like to bring an issue to the moderators attention, please use the "Create Report" feature on the offending comment or post and it will be reviewed as time allows.
founded 5 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
To detect two keystrokes closely followed, you can use
EventListener
s for theonkeyup
/onkeydown
event. In combination with a variable that determines if the key was already pressed within the last 100 ms and asetTimeout
call that resets that variable after 100 ms, it should be fairly easy to accomplish.