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) { function onKeydown(e) {
var $element = Ox.Focus.focusedElement(), var $element = Ox.Focus.focusedElement(),
isInput = Ox.Focus.focusedElementIsInput(), isInput = Ox.Focus.focusedElementIsInput(),
keyName = Ox.KEYS[e.keyCode], keyName = Ox.KEYS[e.keyCode] || ('keyCode' + e.keyCode),
keyBasename = keyName.split('.')[0], keyBasename = keyName.split('.')[0],
key = Object.keys(Ox.MODIFIER_KEYS).filter(function(key) { key = Object.keys(Ox.MODIFIER_KEYS).filter(function(key) {
return e[key] && Ox.MODIFIER_KEYS[key] != keyBasename; return e[key] && Ox.MODIFIER_KEYS[key] != keyBasename;