fix(keybinding): release held shortcuts and modifiers when the screen locks or the PC sleeps

The lock desktop swallows keyup, so a hold-to-talk recording never ended,
the first shortcut after unlocking was dropped as auto-repeat, and Win from
Win+L made the next suggestion accept wait out the full 1.5s modifier timeout.
On powerMonitor lock-screen/suspend the chord machine now emits released for
emitted triggers and clears its state, and modifier tracking forgets held keys.
This commit is contained in:
Yun Chan 2026-10-21 00:28:40 +09:00
parent 8d003c8fca
commit 3e6cfd1ba8
6 changed files with 94 additions and 2 deletions

View file

@ -73,6 +73,10 @@ vi.mock('electron', () => ({
shell: {
openExternal: vi.fn(async () => undefined),
},
powerMonitor: {
on: vi.fn(),
removeListener: vi.fn(),
},
safeStorage: {
isEncryptionAvailable: vi.fn(() => false),
encryptString: vi.fn((s: string) => Buffer.from(s, 'utf-8')),