WebAppers

/ best free open source web resources /

Shopify

Bind a Hot Key Combination with jQuery Hotkeys

Posted · Category: Code, MIT License

Sometimes when we are developing web applications, we would like to allow users using hotkeys to trigger some functions (e.g. Alt-d to delete a record). How can we achieve it easily? 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. And it works with Safari, Opera, Firefox and IE.

Bind a Hot Key Combination with jQuery Hotkeys

Requirements:jQuery Framework
Demo: http://jshotkeys.googlepages.com/test-static.html
License: MIT License

6 Comments
  • James

    This is very nice, I can see myself using this for those apps where users use the app day in and out. The problem with hotkeys is if you don’t use them regularly you forget them.

  • http://www.binnyva.com/ Binny V A

    This can be used without jQuery – try the base script for this plugin.

  • http://www.a2design.biz/ Alex

    Nice, but functional keys are still working in IE as they meant to, e.g. F5 reloads a page.

  • http://philnelson.name Phil Nelson

    Alex: Rebinding keys that users already expect to do something (e.g. F5 to refresh) is a SUPER bad idea from a usability perspective, for about a million reasons.

  • http://www.boedesign.com Jordan Boesch

    Cool write up, I wrote something similar but made it a jQuery event that you can bind.
    http://boedesign.com/blog/2009/12/30/keystrokes-for-jquery/

  • http://izdelava-spletnih-strani-1a.blogspot.com/ Izdelava Strani

    Interesting, will have to try it in action

Supported By

Deals

Web Browsers Icon Set
Food Icon Set
Flat Icon Set

Flat Icon Set

100 icons