Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
(function() {
'use strict';
document.addEventListener('keydown', function (event) {
if (document.getElementById('chat').style.display.indexOf('block') >= 0) {
tagpro.disableControls = false;
}
});
document.getElementById('chat').addEventListener('keydown', function (event) {
// if (event.keyCode === 65 || event.keyCode === 68 || event.keyCode === 83 || event.keyCode === 87) // pressed A, D, S, W.
if (event.keyCode !== 13 && (event.keyCode < 37 || event.which > 40)) {
event.stopPropagation();
}
});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.