Input should use event.code instead of deprecated event.keyCode to make it work with Dvorak, AZERTY and similar layouts:
|
_document.onkeydown = function(ev){ |
|
_temp = ev.keyCode; |
|
_temp = key_convert[_temp] || _temp; |
|
if (keys[_temp] !== udef) { |
|
keys[_temp] = 1; |
|
preventDefault(ev); |
|
} |
|
} |
|
|
|
_document.onkeyup = function(ev) { |
|
_temp = ev.keyCode; |
|
_temp = key_convert[_temp] || _temp; |
|
if (keys[_temp] !== udef) { |
|
keys[_temp] = 0; |
|
preventDefault(ev); |
|
} |
|
} |
Input should use
event.codeinstead of deprecatedevent.keyCodeto make it work with Dvorak, AZERTY and similar layouts:underrun/source/game.js
Lines 146 to 162 in f933e29