Skip to content

Commit

Permalink
Fix keyCode depreciation
Browse files Browse the repository at this point in the history
  • Loading branch information
Drulikar committed Aug 17, 2023
1 parent 72f5bd8 commit 9041db4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tgui/packages/tgui/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ document.addEventListener('keydown', (e) => {
if (canStealFocus(e.target)) {
return;
}
const code = e.keyCode;
const code = e.code;
const key = new KeyEvent(e, 'keydown', keyHeldByCode[code]);
globalEvents.emit('keydown', key);
globalEvents.emit('key', key);
Expand All @@ -214,7 +214,7 @@ document.addEventListener('keyup', (e) => {
if (canStealFocus(e.target)) {
return;
}
const code = e.keyCode;
const code = e.code;
const key = new KeyEvent(e, 'keyup');
globalEvents.emit('keyup', key);
globalEvents.emit('key', key);
Expand Down

0 comments on commit 9041db4

Please sign in to comment.