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:
Kevin Sawicki
2013-06-28 16:36:55 -07:00
parent 53a92751e6
commit 01f220fb1b
2 changed files with 13 additions and 0 deletions

View File

@@ -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()