开发者

Ruby on Rails: How do I implement shortcut keys in my webapp?

开发者 https://www.devze.com 2023-01-08 12:02 出处:网络
I\'ve heard about javascript solutions, and accessorkeys... Don\'t know either... but there seem to be mixed feelings about which to use.

I've heard about javascript solutions, and accessorkeys...

Don't know either... but there seem to be mixed feelings about which to use.

I want standard key shortcuts for each OS (command for mac, ctrl for everything else)

any help / links / tutoria开发者_运维知识库ls would be very appreciated.


Try using js-hotkeys.

jQuery.Hotkeys plugin lets you easily add and remove handlers for keyboard events anywhere in your code supporting almost any key combination. It takes one line of code to bind/unbind a hot key combination.

Binding 'Ctrl+c'

$(document).bind('keydown', 'ctrl+c', fn);
0

精彩评论

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