mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Support non-English keyboard languages
Use event.which if it is lower than the parsed key identifier. This is the case when a non-English keyboard language is selected and a physical English keyboard is being used. This allows keybindings to still work even when the physical key pressed is different than the key it maps to for the currently selected language. Closes #585
This commit is contained in:
@@ -150,6 +150,7 @@ class Keymap
|
||||
if event.originalEvent.keyIdentifier.indexOf('U+') == 0
|
||||
hexCharCode = event.originalEvent.keyIdentifier[2..]
|
||||
charCode = parseInt(hexCharCode, 16)
|
||||
charCode = Math.min(event.which, charCode) if event.which?
|
||||
key = @keyFromCharCode(charCode)
|
||||
else
|
||||
key = event.originalEvent.keyIdentifier.toLowerCase()
|
||||
|
||||
Reference in New Issue
Block a user