| 7 | * Call this early to avoid delay on first use. |
| 8 | */ |
| 9 | export function prewarmModifiers(): void { |
| 10 | if (prewarmed || process.platform !== 'darwin') { |
| 11 | return |
| 12 | } |
| 13 | prewarmed = true |
| 14 | // Load module in background |
| 15 | try { |
| 16 | // eslint-disable-next-line @typescript-eslint/no-require-imports |
| 17 | const { prewarm } = require('modifiers-napi') as { prewarm: () => void } |
| 18 | prewarm() |
| 19 | } catch { |
| 20 | // Ignore errors during prewarm |
| 21 | } |
| 22 | } |
| 23 | |
| 24 | /** |
| 25 | * Check if a specific modifier key is currently pressed (synchronous). |