Skip to content

Commit aa31031

Browse files
authored
Merge pull request #6 from Levosilimo/main
Implement webcam switching and shortcut disable feature
2 parents 8d4efcb + fe1b4f9 commit aa31031

31 files changed

Lines changed: 715 additions & 544 deletions

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ dist
1212
dist-ssr
1313
dist-electron
1414
release
15+
build
1516
*.local
1617
*.lock
1718

electron-builder.json5

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
arch: ['x64']
2525
}
2626
],
27+
requestedExecutionLevel: "requireAdministrator",
2728
artifactName: '${productName}-Windows-${version}-Setup.${ext}'
2829
},
2930
nsis: {

electron/electron-env.d.ts

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
/// <reference types="vite-plugin-electron/electron-env" />
22

3+
import { AppConfig, Shortcut } from '@/utils/types'
4+
35
declare namespace NodeJS {
46
interface ProcessEnv {
57
/**
@@ -21,20 +23,19 @@ declare namespace NodeJS {
2123
}
2224
}
2325

24-
// Used in Renderer process, expose in `preload.ts`
2526
declare global {
2627
interface Window {
2728
ipcRenderer: import('electron').IpcRenderer
28-
// 对应 preload 的 api Key
29+
/* 对应 preload 的 api Key
30+
Used in Renderer process, expose in `preload.ts` */
2931
windowApi: WindowApi
3032
configApi: ConfigApi
3133
controlApi: ControlApi
3234
}
33-
type AppConfig = {
34-
name: string;
35-
icon: string;
36-
shortcut: {
37-
[shortcutName: string]: [string, string];
35+
36+
interface Navigator {
37+
keyboard: {
38+
getLayoutMap: () => Map<string, string>;
3839
};
3940
}
4041
}
@@ -54,8 +55,9 @@ interface ConfigApi {
5455
initialConfig: () => Promise<AppConfig[]>;
5556
updateAppConfig: (appName: string, base64Icon: string) => Promise<boolean>
5657
deleteAppConfig: (appName: string) => Promise<boolean>;
57-
updateShortcutConfig: (appName: string, shortcut: string, leftHand: string, rightHand: string) => Promise<boolean>;
58-
deleteShortcutConfig: (appName: string, shortcut: string) => Promise<boolean>;
58+
updateShortcutConfig: (appName: string, shortcut: Shortcut) => Promise<boolean>;
59+
deleteShortcutConfig: (appName: string, keyCombination: string) => Promise<boolean>;
60+
toggleShortcutConfig: (appName: string, shortcut: Shortcut) => Promise<boolean>;
5961
getBase64Icon: (appPath: string) => Promise<string>
6062
getProjectVersion: () => Promise<string>;
6163
}

0 commit comments

Comments
 (0)