-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathkey_constants.go
68 lines (66 loc) · 1.02 KB
/
key_constants.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
package terminal
// Giant list of key constants. Everything above KeyUnknown matches an actual
// ASCII key value. After that, we have various pseudo-keys in order to
// represent complex byte sequences that correspond to keys like Page up, Right
// arrow, etc.
const (
KeyCtrlA = 1 + iota
KeyCtrlB
KeyCtrlC
KeyCtrlD
KeyCtrlE
KeyCtrlF
KeyCtrlG
KeyCtrlH
KeyCtrlI
KeyCtrlJ
KeyCtrlK
KeyCtrlL
KeyCtrlM
KeyCtrlN
KeyCtrlO
KeyCtrlP
KeyCtrlQ
KeyCtrlR
KeyCtrlS
KeyCtrlT
KeyCtrlU
KeyCtrlV
KeyCtrlW
KeyCtrlX
KeyCtrlY
KeyCtrlZ
KeyEscape
KeyLeftBracket = '['
KeyRightBracket = ']'
KeyEnter = '\r'
KeyBackspace = 127
KeyUnknown = 0xd800 /* UTF-16 surrogate area */ + iota
KeyUp
KeyDown
KeyLeft
KeyRight
KeyHome
KeyEnd
KeyPasteStart
KeyPasteEnd
KeyInsert
KeyDelete
KeyPgUp
KeyPgDn
KeyPause
KeyF1
KeyF2
KeyF3
KeyF4
KeyF5
KeyF6
KeyF7
KeyF8
KeyF9
KeyF10
KeyF11
KeyF12
)
var pasteStart = []byte{KeyEscape, '[', '2', '0', '0', '~'}
var pasteEnd = []byte{KeyEscape, '[', '2', '0', '1', '~'}