This commit is contained in:
2025-12-08 20:17:31 +08:00
parent 7b99bc0b54
commit 42c8b2002e
2 changed files with 21 additions and 5 deletions

View File

@@ -36,8 +36,23 @@ export const useStore = create<StoreState>((set) => ({
mockData.unshift({
id: 'item-search',
title: 'win+d 显示桌面',
data: { type: "hotkeys", hotkeys: "win+d" },
iconUrl: 'https://api.dicebear.com/7.x/icons/svg?seed=search',
description: '显示桌面'
});
mockData.unshift({
id: 'item-recor',
title: 'ctrl+alt+h 开始或停止语音转文字',
data: { type: "hotkeys", hotkeys: "ctrl+alt+h" },
iconUrl: 'https://api.dicebear.com/7.x/icons/svg?seed=record',
description: '开始或停止语音转文字'
})
mockData.unshift({
id: 'item-newtab',
title: 'ctrl+t 打开浏览器新标签页',
data: { type: "hotkeys", hotkeys: "ctrl+t" },
iconUrl: 'https://api.dicebear.com/7.x/icons/svg?seed=newtab',
description: '打开浏览器新标签页'
})
// Simulate network delay
await new Promise(resolve => setTimeout(resolve, 800));
@@ -46,9 +61,10 @@ export const useStore = create<StoreState>((set) => ({
},
sendEvent: async (item: CardItem) => {
// client/router?path=key-sender&keys=win+d
console.log('Sending event for item:', item);
const res = await query.post({
path: 'key-sender',
keys: 'win+d'
keys: item?.data?.hotkeys || 'win+d'
});
console.log('Event sent for item:', item, 'Response:', res);
if (res.code !== 200) {