don't break on unknown keys

This commit is contained in:
j 2015-05-23 13:02:39 +02:00
parent 9deffcfee2
commit 6988dfa89f

View file

@ -77,7 +77,7 @@
function onKeydown(e) {
var $element = Ox.Focus.focusedElement(),
isInput = Ox.Focus.focusedElementIsInput(),
keyName = Ox.KEYS[e.keyCode],
keyName = Ox.KEYS[e.keyCode] || ('keyCode' + e.keyCode),
keyBasename = keyName.split('.')[0],
key = Object.keys(Ox.MODIFIER_KEYS).filter(function(key) {
return e[key] && Ox.MODIFIER_KEYS[key] != keyBasename;
@ -499,4 +499,4 @@
document.addEventListener('keydown', onKeydown);
window.addEventListener('message', onMessage);
}());
}());