Skip to main content
deleted 47 characters in body
Source Link
adeneo
  • 319.1k
  • 29
  • 410
  • 392

Use the keypress event

$(document).keypress(function(event) { if (event.which === 666) { action(); } }); 

I don't have an azerty keyboard or whatever, so I don't get the same keycodes, but the keypress event will return other keycodes, you'll have to check them yourself.

Or you could check for the event.shiftKey

FIDDLE

Use the keypress event

$(document).keypress(function(event) { if (event.which === 666) { action(); } }); 

I don't have an azerty keyboard or whatever, so I don't get the same keycodes, but the keypress event will return other keycodes, you'll have to check them yourself.

Or you could check for the event.shiftKey

FIDDLE

Use the keypress event

$(document).keypress(function(event) { if (event.which === 666) { action(); } }); 

I don't have an azerty keyboard or whatever, so I don't get the same keycodes, but the keypress event will return other keycodes, you'll have to check them yourself.

FIDDLE

Source Link
adeneo
  • 319.1k
  • 29
  • 410
  • 392

Use the keypress event

$(document).keypress(function(event) { if (event.which === 666) { action(); } }); 

I don't have an azerty keyboard or whatever, so I don't get the same keycodes, but the keypress event will return other keycodes, you'll have to check them yourself.

Or you could check for the event.shiftKey

FIDDLE