From 9eb0aa801052e8619cd0a0e293a0f76da7a4d2c7 Mon Sep 17 00:00:00 2001 From: Marc Brooks Date: Wed, 14 May 2025 15:56:10 -0500 Subject: [PATCH] feat(ui): Add Ctrl+Alt-Backspace combination key to Virtual Keyboard Fixes #445 (somewhat) --- ui/src/components/VirtualKeyboard.tsx | 16 +++++++++++++--- ui/src/keyboardMappings.ts | 1 + 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/ui/src/components/VirtualKeyboard.tsx b/ui/src/components/VirtualKeyboard.tsx index 09a94a6..d98a5d2 100644 --- a/ui/src/components/VirtualKeyboard.tsx +++ b/ui/src/components/VirtualKeyboard.tsx @@ -143,6 +143,16 @@ function KeyboardWrapper() { return; } + if (key === "CtrlAltBackspace") { + sendKeyboardEvent( + [keys["Backspace"]], + [modifiers["ControlLeft"], modifiers["AltLeft"]], + ); + + setTimeout(resetKeyboardState, 100); + return; + } + if (isKeyShift || isKeyCaps) { toggleLayout(); @@ -257,13 +267,13 @@ function KeyboardWrapper() { buttonTheme={[ { class: "combination-key", - buttons: "CtrlAltDelete AltMetaEscape", + buttons: "CtrlAltDelete AltMetaEscape CtrlAltBackspace", }, ]} display={keyDisplayMap} layout={{ default: [ - "CtrlAltDelete AltMetaEscape", + "CtrlAltDelete AltMetaEscape CtrlAltBackspace", "Escape F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12", "Backquote Digit1 Digit2 Digit3 Digit4 Digit5 Digit6 Digit7 Digit8 Digit9 Digit0 Minus Equal Backspace", "Tab KeyQ KeyW KeyE KeyR KeyT KeyY KeyU KeyI KeyO KeyP BracketLeft BracketRight Backslash", @@ -272,7 +282,7 @@ function KeyboardWrapper() { "ControlLeft AltLeft MetaLeft Space MetaRight AltRight", ], shift: [ - "CtrlAltDelete AltMetaEscape", + "CtrlAltDelete AltMetaEscape CtrlAltBackspace", "Escape F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12", "(Backquote) (Digit1) (Digit2) (Digit3) (Digit4) (Digit5) (Digit6) (Digit7) (Digit8) (Digit9) (Digit0) (Minus) (Equal) (Backspace)", "Tab (KeyQ) (KeyW) (KeyE) (KeyR) (KeyT) (KeyY) (KeyU) (KeyI) (KeyO) (KeyP) (BracketLeft) (BracketRight) (Backslash)", diff --git a/ui/src/keyboardMappings.ts b/ui/src/keyboardMappings.ts index 79ed11a..9ea788a 100644 --- a/ui/src/keyboardMappings.ts +++ b/ui/src/keyboardMappings.ts @@ -227,6 +227,7 @@ export const modifierDisplayMap: Record = { export const keyDisplayMap: Record = { CtrlAltDelete: "Ctrl + Alt + Delete", AltMetaEscape: "Alt + Meta + Escape", + CtrlAltBackspace: "Ctrl + Alt + Backspace", Escape: "esc", Tab: "tab", Backspace: "backspace",