feat: add platform detection for keyboard functionality to support macOS and Windows

This commit is contained in:
PandaDEV 2025-03-16 23:29:38 +01:00
parent 3a5e2cba7e
commit bbd7a54948
No known key found for this signature in database
GPG key ID: 13EFF9BAF70EE75C

View file

@ -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();