Permalink
Browse files

added ability to bind to input fields by default by setting inputBind…

…ing to true
  • Loading branch information...
1 parent db49774 commit 01ea0e21082bf760a1ee94a0c12faed7b6786955 @joshk joshk committed Apr 25, 2010
Showing with 5 additions and 3 deletions.
  1. +5 −3 jquery.hotkeys.js
View
8 jquery.hotkeys.js
@@ -29,7 +29,9 @@
"`": "~", "1": "!", "2": "@", "3": "#", "4": "$", "5": "%", "6": "^", "7": "&",
"8": "*", "9": "(", "0": ")", "-": "_", "=": "+", ";": ": ", "'": "\"", ",": "<",
".": ">", "/": "?", "\\": "|"
- }
+ },
+
+ inputBinding: false
};
function keyHandler( handleObj ) {
@@ -43,8 +45,8 @@
handleObj.handler = function( event ) {
// Don't fire in text-accepting inputs that we didn't directly bind to
- if ( this !== event.target && (/textarea|select/i.test( event.target.nodeName ) ||
- event.target.type === "text") ) {
+ if ( !jQuery.hotkeys.inputBinding && this !== event.target &&
+ (/textarea|select/i.test( event.target.nodeName ) || event.target.type === "text") ) {
return;
}

0 comments on commit 01ea0e2

Please sign in to comment.