mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-02-28 06:22:45 -08:00
feat: replace y-j with configurable Jimaku shortcut
This commit is contained in:
@@ -2,6 +2,7 @@ import { ConfiguredShortcuts } from "../utils/shortcut-config";
|
||||
|
||||
export interface OverlayShortcutFallbackHandlers {
|
||||
openRuntimeOptions: () => void;
|
||||
openJimaku: () => void;
|
||||
markAudioCard: () => void;
|
||||
copySubtitleMultiple: (timeoutMs: number) => void;
|
||||
copySubtitle: () => void;
|
||||
@@ -34,6 +35,12 @@ export function runOverlayShortcutLocalFallback(
|
||||
handlers.openRuntimeOptions();
|
||||
},
|
||||
},
|
||||
{
|
||||
accelerator: shortcuts.openJimaku,
|
||||
run: () => {
|
||||
handlers.openJimaku();
|
||||
},
|
||||
},
|
||||
{
|
||||
accelerator: shortcuts.markAudioCard,
|
||||
run: () => {
|
||||
|
||||
@@ -13,6 +13,7 @@ export interface OverlayShortcutHandlers {
|
||||
toggleSecondarySub: () => void;
|
||||
markAudioCard: () => void;
|
||||
openRuntimeOptions: () => void;
|
||||
openJimaku: () => void;
|
||||
}
|
||||
|
||||
export function registerOverlayShortcutsService(
|
||||
@@ -118,6 +119,13 @@ export function registerOverlayShortcutsService(
|
||||
"openRuntimeOptions",
|
||||
);
|
||||
}
|
||||
if (shortcuts.openJimaku) {
|
||||
registerOverlayShortcut(
|
||||
shortcuts.openJimaku,
|
||||
() => handlers.openJimaku(),
|
||||
"openJimaku",
|
||||
);
|
||||
}
|
||||
|
||||
return registeredAny;
|
||||
}
|
||||
@@ -155,4 +163,7 @@ export function unregisterOverlayShortcutsService(
|
||||
if (shortcuts.openRuntimeOptions) {
|
||||
globalShortcut.unregister(shortcuts.openRuntimeOptions);
|
||||
}
|
||||
if (shortcuts.openJimaku) {
|
||||
globalShortcut.unregister(shortcuts.openJimaku);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ export interface ConfiguredShortcuts {
|
||||
toggleSecondarySub: string | null | undefined;
|
||||
markAudioCard: string | null | undefined;
|
||||
openRuntimeOptions: string | null | undefined;
|
||||
openJimaku: string | null | undefined;
|
||||
}
|
||||
|
||||
export function resolveConfiguredShortcuts(
|
||||
@@ -78,5 +79,8 @@ export function resolveConfiguredShortcuts(
|
||||
config.shortcuts?.openRuntimeOptions ??
|
||||
defaultConfig.shortcuts?.openRuntimeOptions,
|
||||
),
|
||||
openJimaku: normalizeShortcut(
|
||||
config.shortcuts?.openJimaku ?? defaultConfig.shortcuts?.openJimaku,
|
||||
),
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user