mirror of
https://github.com/0PandaDEV/Qopy.git
synced 2025-04-22 05:34:04 +02:00
feat: add platform detection for keyboard functionality to support macOS and Windows
This commit is contained in:
parent
3a5e2cba7e
commit
bbd7a54948
1 changed files with 7 additions and 0 deletions
|
@ -1,4 +1,5 @@
|
||||||
import { Key, keyboard } from "wrdu-keyboard";
|
import { Key, keyboard } from "wrdu-keyboard";
|
||||||
|
import { platform } from "@tauri-apps/plugin-os";
|
||||||
|
|
||||||
type KeyboardHandler = (event: KeyboardEvent) => void;
|
type KeyboardHandler = (event: KeyboardEvent) => void;
|
||||||
|
|
||||||
|
@ -256,6 +257,12 @@ const initKeyboardHandlers = () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
export default defineNuxtPlugin(async (nuxtApp) => {
|
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();
|
initKeyboardHandlers();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue