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