From 9041db464d5264166f04f700747e977330ef2117 Mon Sep 17 00:00:00 2001 From: Drulikar Date: Thu, 17 Aug 2023 02:38:12 -0700 Subject: [PATCH] Fix keyCode depreciation --- tgui/packages/tgui/events.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tgui/packages/tgui/events.js b/tgui/packages/tgui/events.js index a0bc2ab2da32..6eb4351194b7 100644 --- a/tgui/packages/tgui/events.js +++ b/tgui/packages/tgui/events.js @@ -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); @@ -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);