question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Several keys with identical key codes in AZERTY

See original GitHub issue

For example the

  • <kbd>shift</kbd><kbd>,</kbd> (?) and <kbd>shift</kbd><kbd>:</kbd> (/) both give keycode 191.
  • The <kbd>=</kbd> and <kbd>shift</kbd><kbd>=</kbd> (+) both give 187
  • The numbers (for which you normally need to press <kbd>shift</kbd>) all show as their keycode without shift, except <kbd>4</kbd>, which shows <kbd>'</kbd> 222 and <kbd>4</kbd> 52when <kbd>shift</kbd> is also pressed
  • the @# key shows in both cases 192, a key which on Windows keyboards shows superscript 2 and 3

reference image

Not really sure how this can be resolved since there will be loads of differences per language and different keys with the same keycode.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
cwadrupldijjitcommented, Nov 23, 2018

From what it looks like on the KeyboardEvent documentation on MDN, the reason for this and similar issues is the fact that the event.which and the event.code are both deprecated or not suggested for use, the reason for it being that they don’t really support cleanly the current keyboard layout of the user. I think generally using the event.key as well as the event.location is a better option for this.

I think this is less of a failing of this tool and more a failing of the browsers and one that cannot be undone because it’s now a feature websites use.

Additionally, I think that the real improvement would come from adding an event.location cell in the table on the bottom. I may do that when I have some time, though I’ve noticed that there are some PRs in here from years ago with little to no explanation as to why they weren’t merged. Is this project still being maintained?

0reactions
palashmoncommented, Nov 23, 2018

Thanks for your explanation on this issue. Looking forward to seeing your PR, whenever you get time. Closing this issue for now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Several keys with identical key codes in AZERTY #88 - GitHub
working on the product of the company I work for, I can tell you that the ASCII codes for AZERTY are messed up,...
Read more >
(Solved) Are the keycodes the same for all keyboards?
It is impossible to have the same keyboard key codes for keys matching a certain symbol on a qwerty keyboard as on an...
Read more >
Keyboard Change Cipher - Online QWERTY Shifter/Converter
Tool to simulate a computer keyboard change: typing the keys in position P on a keyboard in the same key in position P...
Read more >
Appendix B. Keyboard Key Code Values - O'Reilly
Key Key value Key Key value Alt 18 F5 116 Arrow Down 40 F6 117 Arrow Left 37 F7 118
Read more >
Key code for common characters on international keyboards
If you have a QWERTY-keyboard, you'd get key code 81 when you type q . When you have an AZERTY-keyboard, do you get...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found