I have the following code:
each shortcut is for different functionality, but when I use ctrl+r it displays the alert 4 times. Am I doing anything wrong? the code below looks fine for me...
I'm using chrome, but I don't think it matters
$(document).bind('keydown', 'ctrl+r', function (event) {
alert("should be only once");
event.preventDefault();
return false;
});
$(document).bind('keydown', 'ctrl+1', function () {
//other code
return false;
});
$(document).bind('keydown', 'ctrl+2', function () {
//other code
return false;
});
$(document).bind('keydown', 'ctrl+3', function () {
//other code
return false;
});
Edit: I am using Hotkeys JQuery plugin