(options)
| 26 | ) => void; |
| 27 | |
| 28 | const keyDownEvent: KeyEventHandler = (options) => { |
| 29 | // eslint-disable-next-line @typescript-eslint/no-deprecated |
| 30 | const { keyCode } = options; |
| 31 | const action = _keyBindings[keyCode]; |
| 32 | |
| 33 | emit(KEYDOWN, action, keyCode, action ? !_keyLocked[action] : true); |
| 34 | |
| 35 | if (action) { |
| 36 | if (!_keyLocked[action]) { |
| 37 | const trigger = |
| 38 | ("mouseButton" in options ? options.mouseButton : undefined) ?? keyCode; |
| 39 | if (!_keyRefs[action][trigger]) { |
| 40 | _keyStatus[action]++; |
| 41 | _keyRefs[action][trigger] = true; |
| 42 | } |
| 43 | } |
| 44 | if ("preventDefault" in options && _preventDefaultForKeys[keyCode]) { |
| 45 | options.preventDefault(); |
| 46 | } |
| 47 | } |
| 48 | }; |
| 49 | |
| 50 | const keyUpEvent: KeyEventHandler = (options) => { |
| 51 | // eslint-disable-next-line @typescript-eslint/no-deprecated |
no test coverage detected