MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / parseKeystroke

Function parseKeystroke

source code/keybindings/parser.ts:15–77  ·  view source on GitHub ↗
(input: string)

Source from the content-addressed store, hash-verified

13 * cmd/command/super/win).
14 */
15export function parseKeystroke(input: string): ParsedKeystroke {
16 const parts = input.split('+')
17 const keystroke: ParsedKeystroke = {
18 key: '',
19 ctrl: false,
20 alt: false,
21 shift: false,
22 meta: false,
23 super: false,
24 }
25 for (const part of parts) {
26 const lower = part.toLowerCase()
27 switch (lower) {
28 case 'ctrl':
29 case 'control':
30 keystroke.ctrl = true
31 break
32 case 'alt':
33 case 'opt':
34 case 'option':
35 keystroke.alt = true
36 break
37 case 'shift':
38 keystroke.shift = true
39 break
40 case 'meta':
41 keystroke.meta = true
42 break
43 case 'cmd':
44 case 'command':
45 case 'super':
46 case 'win':
47 keystroke.super = true
48 break
49 case 'esc':
50 keystroke.key = 'escape'
51 break
52 case 'return':
53 keystroke.key = 'enter'
54 break
55 case 'space':
56 keystroke.key = ' '
57 break
58 case '↑':
59 keystroke.key = 'up'
60 break
61 case '↓':
62 keystroke.key = 'down'
63 break
64 case '←':
65 keystroke.key = 'left'
66 break
67 case '→':
68 keystroke.key = 'right'
69 break
70 default:
71 keystroke.key = lower
72 break

Callers 3

parseChordFunction · 0.85
validateKeystrokeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected