(codepoint: number)
| 37 | }>; |
| 38 | |
| 39 | export function codepointToKeyCode(codepoint: number): number | null { |
| 40 | if (codepoint >= 97 && codepoint <= 122) { |
| 41 | return codepoint - 32; |
| 42 | } |
| 43 | if (codepoint >= 65 && codepoint <= 90) { |
| 44 | return codepoint; |
| 45 | } |
| 46 | if (codepoint >= 32 && codepoint <= 126) { |
| 47 | return codepoint; |
| 48 | } |
| 49 | return null; |
| 50 | } |
| 51 | |
| 52 | export function codepointToCtrlKeyCode(codepoint: number): number | null { |
| 53 | if (codepoint === 9 || codepoint === 13) { |