Fix keyboard handling for IE10 (issue #352)
* Keyboard events in IE10 do not provide any useful information on the properties 'which', 'char' or 'charCode'. Instead, it seems to store the char code in the keyCode property.
This commit is contained in:
samhed
2014-04-14 13:26:52 +02:00
parent 9c377e3031
commit 11c2f536fa

View File

@@ -173,7 +173,10 @@ var kbdUtil = (function() {
else if (evt.charCode) {
codepoint = evt.charCode;
}
else if (evt.keyCode && evt.type === 'keypress') {
// IE10 stores the char code as keyCode, and has no other useful properties
codepoint = evt.keyCode;
}
if (codepoint) {
var res = keysyms.fromUnicode(substituteCodepoint(codepoint));
if (res) {