Skip to content

WASD keys do not work with Dvorak layout in Firefox #13

@link2xt

Description

@link2xt

Input should use event.code instead of deprecated event.keyCode to make it work with Dvorak, AZERTY and similar layouts:

underrun/source/game.js

Lines 146 to 162 in f933e29

_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);
}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions