Here is a Jsfiddle http://jsfiddle.net/EzLnH/.
If I change the function to:
$(document).bind('keypress', function(event) {
if (event.which === 77 && event.shiftKey) {
alert('You pressed ctrl+m');
}
});
It works but the function in jsfiddle does not.
Any Ideas?
Chaniging it to
$(document).on("keydown"...worked for me. You should be using .on now, .bind is deprecated in jQuery 1.8+. The issue was the “keypress” part though, modifier keys don’t get picked up by a keypress event so it seems.Here’s the Fiddle