Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Chrome Extensions: Any way to tell when a key is pressed and held?

I'm currently developing an extension for chrome that takes action based on shortcut keys for specific web pages. Right now I'm using the "command" API to tell when a shortcut key is pressed ( https://developer.chrome.com/extensions/commands ). Is there any way to tell if a key is pressed and held? I only want this specific action to take place when that is the case.

like image 896
Beachj Avatar asked Sep 05 '25 01:09

Beachj


1 Answers

You can use jQuery.Hotkeys

jQuery Hotkeys lets you watch for keyboard events anywhere in your code supporting almost any key combination.

like image 81
Shweta Matkar Avatar answered Sep 07 '25 17:09

Shweta Matkar