diff --git a/tgui/packages/tgui/interfaces/KeyBinds.jsx b/tgui/packages/tgui/interfaces/KeyBinds.jsx index b387d6a8dba5..9f60f6d7cb61 100644 --- a/tgui/packages/tgui/interfaces/KeyBinds.jsx +++ b/tgui/packages/tgui/interfaces/KeyBinds.jsx @@ -10,6 +10,20 @@ const KEY_MODS = { 'CONTROL': true, }; +const KEY_CODE_TO_BYOND = { + DEL: 'Delete', + DOWN: 'South', + END: 'Southwest', + HOME: 'Northwest', + INSERT: 'Insert', + LEFT: 'West', + PAGEDOWN: 'Southeast', + PAGEUP: 'Northeast', + RIGHT: 'East', + ' ': 'Space', + UP: 'North', +}; + const getAllKeybinds = (glob_keybinds) => { const all_keybinds = new Array(); Object.keys(glob_keybinds).map((x) => all_keybinds.push(...glob_keybinds[x])); @@ -274,6 +288,10 @@ export class ButtonKeybind extends Component { return; } + if (KEY_CODE_TO_BYOND[pressedKey]) { + pressedKey = KEY_CODE_TO_BYOND[pressedKey]; + } + if (e.keyCode >= 96 && e.keyCode <= 105) { pressedKey = 'Numpad' + pressedKey; }