( keyId: string, )
| 786 | } |
| 787 | |
| 788 | function parseKeyId( |
| 789 | keyId: string, |
| 790 | ): { key: string; ctrl: boolean; shift: boolean; alt: boolean; super: boolean } | null { |
| 791 | const parts = keyId.toLowerCase().split("+"); |
| 792 | const key = parts[parts.length - 1]; |
| 793 | if (!key) return null; |
| 794 | return { |
| 795 | key, |
| 796 | ctrl: parts.includes("ctrl"), |
| 797 | shift: parts.includes("shift"), |
| 798 | alt: parts.includes("alt"), |
| 799 | super: parts.includes("super"), |
| 800 | }; |
| 801 | } |
| 802 | |
| 803 | /** |
| 804 | * Match input data against a key identifier string. |