* Resets the singleton instance. Useful for testing.
()
| 95 | /** Read once, since mousemove reads lock state many times a second. */ |
| 96 | #mac = detectPlatform() === 'mac' |
| 97 | /** Lock key states, published with the next held key or lock change. */ |
| 98 | #locks = unknownLocks() |
| 99 | /** Window listeners as `[type, listener, capture]`, removed together on destroy. */ |
| 100 | #listeners: Array<[string, EventListener, boolean]> = [] |
| 101 | |
| 102 | private constructor() { |
| 103 | this.#setupListeners() |
| 104 | } |
| 105 |