dmauro / Keypress

A keyboard input capturing utility in which any key can be a modifier key.
http://dmauro.github.io/Keypress/
Apache License 2.0
3.18k stars 313 forks source link

jQuery integration #134

Closed MareoRaft closed 7 years ago

MareoRaft commented 7 years ago

I am wondering what the best way is to use your library with a jQuery selector. I am trying to do something like this:

$('.input_place').keyComboDown(function(event){
    if( event.keycode == "shift x" ){
        dostuff()
    }
})

Thanks for your help.

dmauro commented 7 years ago

Check out the documentation here: http://dmauro.github.io/Keypress/

You can pass a DOM element into the Listener constructor. You'll need a Listener for each DOM element you want to listen for.