Skip to main content
put a picture in, in hopes that people will finally pay some attention
Source Link
T.J. Crowder
  • 1.1m
  • 201
  • 2k
  • 2k

When I bind the ? and the / key with javascript on qwerty keyboard they have the same keycode (191) but you have to press shift to do a ?.

How can I make sure that it'stell which character was pressed on an azerty keyboard (layout shown below), as they're different keys, both require Shift, and I get the same keycode for both characters on an azerty keyboard; i.ethem in keyup. the following code will work the same way:

 $(document).keyup(function(event) { if (event.which === 191) { action(); } }); 

Layout

(Original image is "KB France" by Yitscar (English Wikipedia) Michka B (French Wikipedia) Licensed under Creative Commons Attribution-Share Alike 3.0 via Wikimedia Commons - see use in the article linked above.)

When I bind the ? and the / key with javascript on qwerty keyboard they have the same keycode (191) but you have to press shift to do a ?.

How can I make sure that it's the same keycode for both characters on an azerty keyboard; i.e. the following code will work the same way:

 $(document).keyup(function(event) { if (event.which === 191) { action(); } }); 

When I bind the ? and the / key with javascript on qwerty keyboard they have the same keycode (191) but you have to press shift to do a ?.

How can I tell which character was pressed on an azerty keyboard (layout shown below), as they're different keys, both require Shift, and I get the same keycode for them in keyup.:

 $(document).keyup(function(event) { if (event.which === 191) { action(); } }); 

Layout

(Original image is "KB France" by Yitscar (English Wikipedia) Michka B (French Wikipedia) Licensed under Creative Commons Attribution-Share Alike 3.0 via Wikimedia Commons - see use in the article linked above.)

Improved clarity
Source Link
MarioDS
  • 13.1k
  • 15
  • 70
  • 123

When I bind the ?? and the // key with javascript on qwerty keyboard they have the same keycode (191) but you have to press shiftshift to do a ??. But how to do with azerty keyboard, the both key have

How can I make sure that it's the same keycode and need shiftfor both characters on an azerty keyboard; i.

Mye. the following code will work the same way:

 $(document).keyup(function(event) { if (event.which === 191) { action(); } }); 

When I bind the ? and the / key with javascript on qwerty keyboard they have the same keycode (191) but you have to press shift to do a ?. But how to do with azerty keyboard, the both key have the same keycode and need shift.

My code :

 $(document).keyup(function(event) { if (event.which === 191) { action(); } }); 

When I bind the ? and the / key with javascript on qwerty keyboard they have the same keycode (191) but you have to press shift to do a ?.

How can I make sure that it's the same keycode for both characters on an azerty keyboard; i.e. the following code will work the same way:

 $(document).keyup(function(event) { if (event.which === 191) { action(); } }); 
Removed tag from title
Link
Huangism
  • 16.5k
  • 7
  • 51
  • 75

Javascript keycode - How to make difference between question mark ? and / for azerty keyboard

added 28 characters in body
Source Link
Girish
  • 12.1k
  • 3
  • 37
  • 54
Loading
Source Link
agauchy
  • 117
  • 3
  • 10
Loading