From 7602aefe98d723156ed020767471791f424b44af Mon Sep 17 00:00:00 2001 From: Cameron Fleming Date: Sat, 4 Jan 2025 00:10:56 +0000 Subject: [PATCH 1/2] feat(ui/ActionBar): add Ctrl + Alt + Del button to Action Bar This commit adds a CTRL + ALT + DEL button to the Action Bar allowing you to send the combination to the target machine without launching the Virtual Keyboard, or sending the signal to the computer you're accessing the KVM from. This is useful for people installing OS', or potentially debugging kernel issues. --- ui/src/components/ActionBar.tsx | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/ui/src/components/ActionBar.tsx b/ui/src/components/ActionBar.tsx index cd5432c..8507737 100644 --- a/ui/src/components/ActionBar.tsx +++ b/ui/src/components/ActionBar.tsx @@ -10,12 +10,14 @@ import Container from "@components/Container"; import { LuHardDrive, LuMaximize, LuSettings, LuSignal } from "react-icons/lu"; import { cx } from "@/cva.config"; import PasteModal from "@/components/popovers/PasteModal"; -import { FaKeyboard } from "react-icons/fa6"; +import { FaKeyboard, FaLock } from "react-icons/fa6"; import WakeOnLanModal from "@/components/popovers/WakeOnLan/Index"; import { Popover, PopoverButton, PopoverPanel } from "@headlessui/react"; import MountPopopover from "./popovers/MountPopover"; import { Fragment, useCallback, useRef } from "react"; import { CommandLineIcon } from "@heroicons/react/20/solid"; +import useKeyboard from "@/hooks/useKeyboard"; +import { keys, modifiers } from "@/keyboardMappings"; export default function Actionbar({ requestFullscreen, @@ -52,6 +54,8 @@ export default function Actionbar({ [setDisableFocusTrap], ); + const { sendKeyboardEvent, resetKeyboardState } = useKeyboard(); + return (
setVirtualKeyboard(!virtualKeyboard)} />
+
+
From a8197397902f46cbca67f00a32cd1118bf6bc76e Mon Sep 17 00:00:00 2001 From: Cameron Fleming Date: Sat, 4 Jan 2025 00:22:08 +0000 Subject: [PATCH 2/2] feat(ui): make Ctrl + Alt + Del button a setting This commit makes the Action Bar Ctrl + Alt + Del button a setting, which is off by default. --- ui/src/components/ActionBar.tsx | 19 ++++++++++--------- ui/src/components/sidebar/settings.tsx | 9 +++++++++ ui/src/hooks/stores.ts | 6 ++++++ 3 files changed, 25 insertions(+), 9 deletions(-) diff --git a/ui/src/components/ActionBar.tsx b/ui/src/components/ActionBar.tsx index 8507737..1a39e78 100644 --- a/ui/src/components/ActionBar.tsx +++ b/ui/src/components/ActionBar.tsx @@ -207,22 +207,23 @@ export default function Actionbar({ onClick={() => setVirtualKeyboard(!virtualKeyboard)} />
-
-
+ }} + /> + + )}
diff --git a/ui/src/components/sidebar/settings.tsx b/ui/src/components/sidebar/settings.tsx index ec606a6..bbde099 100644 --- a/ui/src/components/sidebar/settings.tsx +++ b/ui/src/components/sidebar/settings.tsx @@ -796,6 +796,15 @@ export default function SettingsSidebar() { }} /> + + settings.setActionBarCtrlAltDel(e.target.checked)} + /> +
void; + + actionBarCtrlAltDel: boolean; + setActionBarCtrlAltDel: (enabled: boolean) => void; } export const useSettingsStore = create( @@ -287,6 +290,9 @@ export const useSettingsStore = create( // Add developer mode with default value developerMode: false, setDeveloperMode: enabled => set({ developerMode: enabled }), + + actionBarCtrlAltDel: false, + setActionBarCtrlAltDel: enabled => set({ actionBarCtrlAltDel: enabled }), }), { name: "settings",