开发者

Bind Ctrl and Ctrl+key by using jquery.hotkeys.js

I'm using jquery (latest version) together with jquery.hotkeys.js. What I would like to acchieve is: I would like to bind Ctrl+V (ok that is an easy one) but in addition I have to capture the Ctrl only because I'm using the Ctrl for gathering selections.

At the moment I don't see how to solve it with jquery.hotkeys.js. Has anyone any idea as to this issue开发者_运维技巧?

Thank you!


Well, I'm not familiar with that plugin, but for just catching a keyup / keydown event with a Ctrl, you can just bind

$( document.body ).keyup(function( event ) {
   if( event.which === 17 ) {
       // yay
   } 
});

I'm not super sure if Ctrl has the keyCode of 17 on every platform out there, that you might want to double check.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜