From 9b721591c9b06443df513f7fcdea2ab6b7c9ce00 Mon Sep 17 00:00:00 2001 From: Marc Brooks Date: Wed, 14 May 2025 18:21:57 -0500 Subject: [PATCH] feat(ui): Add Ctrl+Alt+Del to the action bar Since this is the sort of thing we do all the time, make it one-click away --- ui/src/components/ActionBar.tsx | 24 ++++++++++++-- ui/src/hooks/stores.ts | 6 ++++ .../devices.$id.settings.ctrlaltdel.tsx | 28 ++++++++++++++++ .../routes/devices.$id.settings.hardware.tsx | 32 ++++++++++++++++++- 4 files changed, 87 insertions(+), 3 deletions(-) create mode 100644 ui/src/routes/devices.$id.settings.ctrlaltdel.tsx diff --git a/ui/src/components/ActionBar.tsx b/ui/src/components/ActionBar.tsx index 83ae509..7de4571 100644 --- a/ui/src/components/ActionBar.tsx +++ b/ui/src/components/ActionBar.tsx @@ -1,6 +1,6 @@ import { MdOutlineContentPasteGo } from "react-icons/md"; import { LuCable, LuHardDrive, LuMaximize, LuSettings, LuSignal } from "react-icons/lu"; -import { FaKeyboard } from "react-icons/fa6"; +import { FaKeyboard, FaLock} from "react-icons/fa6"; import { Popover, PopoverButton, PopoverPanel } from "@headlessui/react"; import { Fragment, useCallback, useRef } from "react"; import { CommandLineIcon } from "@heroicons/react/20/solid"; @@ -19,6 +19,8 @@ import WakeOnLanModal from "@/components/popovers/WakeOnLan/Index"; import MountPopopover from "@/components/popovers/MountPopover"; import ExtensionPopover from "@/components/popovers/ExtensionPopover"; import { useDeviceUiNavigation } from "@/hooks/useAppNavigation"; +import useKeyboard from "@/hooks/useKeyboard"; +import { keys, modifiers } from "@/keyboardMappings"; export default function Actionbar({ requestFullscreen, @@ -56,6 +58,8 @@ export default function Actionbar({ [setDisableFocusTrap], ); + const { sendKeyboardEvent, resetKeyboardState } = useKeyboard(); + return (
- + {useSettingsStore().actionBarCtrlAltDel && ( +
+
+ )}