forked from tzuryby/jquery.hotkeys
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Backwards incomptabile change! Remove global jquery.hotkeys.inputBind…
…ing setting in favour of per handler inputBinding. Set handler.inputBinding = true to have events fire on inputs.
- Loading branch information
John Boxall
committed
May 3, 2010
1 parent
01ea0e2
commit 65e7a7b
Showing
2 changed files
with
32 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<html> | ||
<head> | ||
<script src="jquery-1.4.2.js"></script> | ||
<script src="../jquery.hotkeys.js"></script> | ||
</head> | ||
|
||
<body> | ||
<p>Try ctrl+s while focused in the input.</p> | ||
<input type="text" /> | ||
|
||
<script> | ||
function bindCtrlSInInput(){ | ||
alert("Ctrl+S"); | ||
return false; | ||
} | ||
bindCtrlSInInput.inputBinding = true; | ||
|
||
$(document).ready(function(){ | ||
$(document).bind('keydown', 'ctrl+s', bindCtrlSInInput); | ||
}); | ||
|
||
</script> | ||
</body></html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters