Compare commits

..

No commits in common. "f37cebd594e6d8a3021dfce88ccb165acb163200" and "95a4ad624a7321d6d48c66c1a9f00f274173c289" have entirely different histories.

8 changed files with 237 additions and 2392 deletions

4
.gitignore vendored
View file

@ -22,5 +22,7 @@ logs
.env .env
.env.* .env.*
!.env.example !.env.example
bun.lockb
.gitignore .gitignore
.vscode .vscode
bun.lock

View file

@ -10,8 +10,10 @@ import { listen } from "@tauri-apps/api/event";
import { app, window } from "@tauri-apps/api"; import { app, window } from "@tauri-apps/api";
import { disable, enable } from "@tauri-apps/plugin-autostart"; import { disable, enable } from "@tauri-apps/plugin-autostart";
import { onMounted } from "vue"; import { onMounted } from "vue";
import { keyboard } from "wrdu-keyboard";
const { $settings } = useNuxtApp(); const { $settings } = useNuxtApp();
keyboard.init();
onMounted(async () => { onMounted(async () => {
await listen("settings", async () => { await listen("settings", async () => {

2109
bun.lock

File diff suppressed because it is too large Load diff

View file

@ -10,17 +10,17 @@
"postinstall": "nuxt prepare" "postinstall": "nuxt prepare"
}, },
"dependencies": { "dependencies": {
"@tauri-apps/api": "2.5.0", "@tauri-apps/api": "2.3.0",
"@tauri-apps/cli": "2.5.0", "@tauri-apps/cli": "2.3.1",
"@tauri-apps/plugin-autostart": "2.3.0", "@tauri-apps/plugin-autostart": "2.2.0",
"@tauri-apps/plugin-os": "2.2.1", "@tauri-apps/plugin-os": "2.2.1",
"nuxt": "3.17.4", "nuxt": "3.16.0",
"overlayscrollbars": "2.11.3", "overlayscrollbars": "2.11.1",
"overlayscrollbars-vue": "0.5.9", "overlayscrollbars-vue": "0.5.9",
"sass-embedded": "1.89.0", "sass-embedded": "1.85.1",
"uuid": "11.1.0", "uuid": "11.1.0",
"vue": "3.5.15", "vue": "3.5.13",
"@waradu/keyboard": "4.2.0" "wrdu-keyboard": "github:0PandaDEV/keyboard"
}, },
"overrides": { "overrides": {
"chokidar": "^3.6.0" "chokidar": "^3.6.0"

View file

@ -73,6 +73,7 @@ import type {
InfoColor, InfoColor,
InfoCode, InfoCode,
} from "~/types/types"; } from "~/types/types";
import { Key, keyboard } from "wrdu-keyboard";
import { import {
selectedGroupIndex, selectedGroupIndex,
selectedItemIndex, selectedItemIndex,
@ -81,7 +82,6 @@ import {
} from "~/lib/selectedResult"; } from "~/lib/selectedResult";
import IconsEnter from "~/components/Icons/Enter.vue"; import IconsEnter from "~/components/Icons/Enter.vue";
import IconsK from "~/components/Icons/K.vue"; import IconsK from "~/components/Icons/K.vue";
import { Key, useKeyboard } from "@waradu/keyboard";
interface GroupedHistory { interface GroupedHistory {
label: string; label: string;
@ -90,8 +90,6 @@ interface GroupedHistory {
const { $history } = useNuxtApp(); const { $history } = useNuxtApp();
const keyboard = useKeyboard();
const CHUNK_SIZE = 50; const CHUNK_SIZE = 50;
const SCROLL_THRESHOLD = 100; const SCROLL_THRESHOLD = 100;
const SCROLL_PADDING = 8; const SCROLL_PADDING = 8;
@ -529,33 +527,33 @@ const setupEventListeners = async (): Promise<void> => {
} }
focusSearchInput(); focusSearchInput();
keyboard.init(); keyboard.clear();
keyboard.listen([Key.DownArrow], () => { keyboard.prevent.down([Key.DownArrow], () => {
selectNext(); selectNext();
}, { prevent: true }); });
keyboard.listen([Key.UpArrow], () => { keyboard.prevent.down([Key.UpArrow], () => {
selectPrevious(); selectPrevious();
}, { prevent: true }); });
keyboard.listen([Key.Enter], () => { keyboard.prevent.down([Key.Enter], () => {
pasteSelectedItem(); pasteSelectedItem();
}, { prevent: true }); });
keyboard.listen([Key.Escape], () => { keyboard.prevent.down([Key.Escape], () => {
hideApp(); hideApp();
}, { prevent: true }); });
switch (os.value) { switch (os.value) {
case "macos": case "macos":
keyboard.listen([Key.Meta, Key.K], () => { }, { prevent: true }); keyboard.prevent.down([Key.LeftMeta, Key.K], () => { });
keyboard.listen([Key.Meta, Key.K], () => { }, { prevent: true }); keyboard.prevent.down([Key.RightMeta, Key.K], () => { });
break; break;
case "linux": case "linux":
case "windows": case "windows":
keyboard.listen([Key.Control, Key.K], () => { }, { prevent: true }); keyboard.prevent.down([Key.LeftControl, Key.K], () => { });
keyboard.listen([Key.Control, Key.K], () => { }, { prevent: true }); keyboard.prevent.down([Key.RightControl, Key.K], () => { });
break; break;
} }
}); });
@ -565,32 +563,32 @@ const setupEventListeners = async (): Promise<void> => {
keyboard.clear(); keyboard.clear();
}); });
keyboard.listen([Key.DownArrow], () => { keyboard.prevent.down([Key.DownArrow], () => {
selectNext(); selectNext();
}, { prevent: true }); });
keyboard.listen([Key.UpArrow], () => { keyboard.prevent.down([Key.UpArrow], () => {
selectPrevious(); selectPrevious();
}, { prevent: true }); });
keyboard.listen([Key.Enter], () => { keyboard.prevent.down([Key.Enter], () => {
pasteSelectedItem(); pasteSelectedItem();
}, { prevent: true }); });
keyboard.listen([Key.Escape], () => { keyboard.prevent.down([Key.Escape], () => {
hideApp(); hideApp();
}, { prevent: true }); });
switch (os.value) { switch (os.value) {
case "macos": case "macos":
keyboard.listen([Key.Meta, Key.K], () => { }, { prevent: true }); keyboard.prevent.down([Key.LeftMeta, Key.K], () => { });
keyboard.listen([Key.Meta, Key.K], () => { }, { prevent: true }); keyboard.prevent.down([Key.RightMeta, Key.K], () => { });
break; break;
case "linux": case "linux":
case "windows": case "windows":
keyboard.listen([Key.Control, Key.K], () => { }, { prevent: true }); keyboard.prevent.down([Key.LeftControl, Key.K], () => { });
keyboard.listen([Key.Control, Key.K], () => { }, { prevent: true }); keyboard.prevent.down([Key.RightControl, Key.K], () => { });
break; break;
} }
}; };
@ -635,10 +633,6 @@ onMounted(async () => {
} }
}); });
onUnmounted(() => {
keyboard.clear();
});
const getFormattedDate = computed(() => { const getFormattedDate = computed(() => {
if (!selectedItem.value?.timestamp) return ""; if (!selectedItem.value?.timestamp) return "";
return new Intl.DateTimeFormat("en-US", { return new Intl.DateTimeFormat("en-US", {

View file

@ -78,10 +78,10 @@ import { onMounted, onUnmounted, reactive, ref } from "vue";
import { platform } from "@tauri-apps/plugin-os"; import { platform } from "@tauri-apps/plugin-os";
import { useRouter } from "vue-router"; import { useRouter } from "vue-router";
import { KeyValues, KeyLabels } from "../types/keys"; import { KeyValues, KeyLabels } from "../types/keys";
import { disable, enable } from "@tauri-apps/plugin-autostart"; import { disable, enable } from "@tauri-apps/plugin-autostart";
import { Key, keyboard } from "wrdu-keyboard";
import BottomBar from "../components/BottomBar.vue"; import BottomBar from "../components/BottomBar.vue";
import IconsEnter from "~/components/Icons/Enter.vue"; import IconsEnter from "~/components/Icons/Enter.vue";
import { Key, useKeyboard } from "@waradu/keyboard";
const activeModifiers = reactive<Set<KeyValues>>(new Set()); const activeModifiers = reactive<Set<KeyValues>>(new Set());
const isKeybindInputFocused = ref(false); const isKeybindInputFocused = ref(false);
@ -93,7 +93,6 @@ const router = useRouter();
const showEmptyKeybindError = ref(false); const showEmptyKeybindError = ref(false);
const autostart = ref(false); const autostart = ref(false);
const { $settings } = useNuxtApp(); const { $settings } = useNuxtApp();
const keyboard = useKeyboard();
const modifierKeySet = new Set([ const modifierKeySet = new Set([
KeyValues.AltLeft, KeyValues.AltLeft,
@ -175,48 +174,48 @@ const toggleAutostart = async () => {
os.value = platform(); os.value = platform();
onMounted(async () => { onMounted(async () => {
keyboard.listen([Key.All], (event: KeyboardEvent) => { keyboard.prevent.down([Key.All], (event: KeyboardEvent) => {
if (isKeybindInputFocused.value) { if (isKeybindInputFocused.value) {
onKeyDown(event); onKeyDown(event);
} }
}, { prevent: true }); });
keyboard.listen([Key.Escape], () => { keyboard.prevent.down([Key.Escape], () => {
if (isKeybindInputFocused.value) { if (isKeybindInputFocused.value) {
keybindInput.value?.blur(); keybindInput.value?.blur();
} else { } else {
router.push("/"); router.push("/");
} }
}, { prevent: true }); });
switch (os.value) { switch (os.value) {
case "macos": case "macos":
keyboard.listen([Key.Meta, Key.Enter], () => { keyboard.prevent.down([Key.LeftMeta, Key.Enter], () => {
if (!isKeybindInputFocused.value) { if (!isKeybindInputFocused.value) {
saveKeybind(); saveKeybind();
} }
}, { prevent: true }); });
keyboard.listen([Key.Meta, Key.Enter], () => { keyboard.prevent.down([Key.RightMeta, Key.Enter], () => {
if (!isKeybindInputFocused.value) { if (!isKeybindInputFocused.value) {
saveKeybind(); saveKeybind();
} }
}, { prevent: true }); });
break; break;
case "linux": case "linux":
case "windows": case "windows":
keyboard.listen([Key.Control, Key.Enter], () => { keyboard.prevent.down([Key.LeftControl, Key.Enter], () => {
if (!isKeybindInputFocused.value) { if (!isKeybindInputFocused.value) {
saveKeybind(); saveKeybind();
} }
}, { prevent: true }); });
keyboard.listen([Key.Control, Key.Enter], () => { keyboard.prevent.down([Key.RightControl, Key.Enter], () => {
if (!isKeybindInputFocused.value) { if (!isKeybindInputFocused.value) {
saveKeybind(); saveKeybind();
} }
}, { prevent: true }); });
break; break;
} }

369
src-tauri/Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -4,49 +4,49 @@ version = "0.4.0"
description = "Qopy" description = "Qopy"
authors = ["pandadev"] authors = ["pandadev"]
edition = "2021" edition = "2021"
rust-version = "1.80" rust-version = "1.70"
[build-dependencies] [build-dependencies]
tauri-build = { version = "2.2.0", features = [] } tauri-build = { version = "2.0.6", features = [] }
[dependencies] [dependencies]
tauri = { version = "2.5.1", features = [ tauri = { version = "2.3.1", features = [
"macos-private-api", "macos-private-api",
"tray-icon", "tray-icon",
"image-png", "image-png",
] } ] }
tauri-plugin-sql = { version = "2.2.0", features = ["sqlite"] } tauri-plugin-sql = { version = "2.2.0", features = ["sqlite"] }
tauri-plugin-autostart = "2.3.0" tauri-plugin-autostart = "2.2.0"
tauri-plugin-os = "2.2.1" tauri-plugin-os = "2.2.1"
tauri-plugin-updater = "2.7.1" tauri-plugin-updater = "2.6.0"
tauri-plugin-dialog = "2.2.2" tauri-plugin-dialog = "2.2.0"
tauri-plugin-fs = "2.3.0" tauri-plugin-fs = "2.2.0"
tauri-plugin-clipboard = "2.1.11" tauri-plugin-clipboard = "2.1.11"
tauri-plugin-prevent-default = "2.1.0" tauri-plugin-prevent-default = "1.2.1"
tauri-plugin-global-shortcut = "2.2.1" tauri-plugin-global-shortcut = "2.2.0"
tauri-plugin-aptabase = "1.0.0" tauri-plugin-aptabase = { git = "https://github.com/aptabase/tauri-plugin-aptabase", branch = "v2" }
sqlx = { version = "0.8.6", features = [ sqlx = { version = "0.8.3", features = [
"runtime-tokio-native-tls", "runtime-tokio-native-tls",
"sqlite", "sqlite",
"chrono", "chrono",
] } ] }
serde = { version = "1.0.219", features = ["derive"] } serde = { version = "1.0.219", features = ["derive"] }
tokio = { version = "1.45.1", features = ["full"] } tokio = { version = "1.44.1", features = ["full"] }
serde_json = "1.0.140" serde_json = "1.0.140"
rdev = "0.5.3" rdev = "0.5.3"
rand = "0.9.1" rand = "0.9.0"
base64 = "0.22.1" base64 = "0.22.1"
image = "0.25.6" image = "0.25.5"
reqwest = { version = "0.12.15", features = ["json", "blocking"] } reqwest = { version = "0.12.14", features = ["json", "blocking"] }
url = "2.5.4" url = "2.5.4"
regex = "1.11.1" regex = "1.11.1"
sha2 = "0.10.9" sha2 = "0.10.8"
lazy_static = "1.5.0" lazy_static = "1.5.0"
time = "0.3.41" time = "0.3.39"
global-hotkey = "0.7.0" global-hotkey = "0.6.4"
chrono = { version = "0.4.41", features = ["serde"] } chrono = { version = "0.4.40", features = ["serde"] }
log = { version = "0.4.27", features = ["std"] } log = { version = "0.4.26", features = ["std"] }
uuid = { version = "1.17.0", features = ["v4"] } uuid = "1.16.0"
include_dir = "0.7.4" include_dir = "0.7.4"
# hyperpolyglot = { git = "https://github.com/0pandadev/hyperpolyglot" } # hyperpolyglot = { git = "https://github.com/0pandadev/hyperpolyglot" }
applications = { git = "https://github.com/HuakunShen/applications-rs", branch = "fix/win-app-detection" } applications = { git = "https://github.com/HuakunShen/applications-rs", branch = "fix/win-app-detection" }