From 2adabcc3a5b80980d8da00b2de0f32cd61b5064d Mon Sep 17 00:00:00 2001 From: harryob <55142896+harryob@users.noreply.github.com> Date: Fri, 19 Apr 2024 18:27:54 +0100 Subject: [PATCH 1/2] we have to override the key description for byonds sake --- tgui/packages/tgui/interfaces/KeyBinds.jsx | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) 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; } From ff7128732bac02087467efadac22663fdb974ddf Mon Sep 17 00:00:00 2001 From: harryob <55142896+harryob@users.noreply.github.com> Date: Sat, 20 Apr 2024 09:26:21 +0100 Subject: [PATCH 2/2] consistent formatting --- tgui/packages/tgui/interfaces/KeyBinds.jsx | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/tgui/packages/tgui/interfaces/KeyBinds.jsx b/tgui/packages/tgui/interfaces/KeyBinds.jsx index 9f60f6d7cb61..b3b2fd5a8c30 100644 --- a/tgui/packages/tgui/interfaces/KeyBinds.jsx +++ b/tgui/packages/tgui/interfaces/KeyBinds.jsx @@ -11,17 +11,17 @@ const KEY_MODS = { }; const KEY_CODE_TO_BYOND = { - DEL: 'Delete', - DOWN: 'South', - END: 'Southwest', - HOME: 'Northwest', - INSERT: 'Insert', - LEFT: 'West', - PAGEDOWN: 'Southeast', - PAGEUP: 'Northeast', - RIGHT: 'East', + 'DEL': 'Delete', + 'DOWN': 'South', + 'END': 'Southwest', + 'HOME': 'Northwest', + 'INSERT': 'Insert', + 'LEFT': 'West', + 'PAGEDOWN': 'Southeast', + 'PAGEUP': 'Northeast', + 'RIGHT': 'East', ' ': 'Space', - UP: 'North', + 'UP': 'North', }; const getAllKeybinds = (glob_keybinds) => {