From bbd7a549487f40edca2068cd210facecae30a8ec Mon Sep 17 00:00:00 2001 From: PandaDEV <70103896+0PandaDEV@users.noreply.github.com> Date: Sun, 16 Mar 2025 23:29:38 +0100 Subject: [PATCH] feat: add platform detection for keyboard functionality to support macOS and Windows --- plugins/keyboard.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/plugins/keyboard.ts b/plugins/keyboard.ts index 1bb6847..17e8d63 100644 --- a/plugins/keyboard.ts +++ b/plugins/keyboard.ts @@ -1,4 +1,5 @@ import { Key, keyboard } from "wrdu-keyboard"; +import { platform } from "@tauri-apps/plugin-os"; type KeyboardHandler = (event: KeyboardEvent) => void; @@ -256,6 +257,12 @@ const initKeyboardHandlers = () => { }; export default defineNuxtPlugin(async (nuxtApp) => { + try { + const osName = platform(); + currentOS = osName.toLowerCase().includes("mac") ? "macos" : "windows"; + } catch (error) { + console.error("Error detecting platform:", error); + } initKeyboardHandlers();