summaryrefslogtreecommitdiff
path: root/tui/termfo/keys/keys.go
blob: fe2424c434a50420748505120da800631c639bb0 (plain)
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
// Code generated by term.h.zsh; DO NOT EDIT.

package keys

import "citrons.xyz/talk/tui/termfo/caps"

// CursesVersion is the version of curses this data was generated with, as [implementation]-[version].
const CursesVersion = `ncurses-6.5.20240511`

// Keys maps caps.Cap to Key constants
var Keys = map[*caps.Cap]Key{
	caps.TableStrs[55]:  Backspace,
	caps.TableStrs[59]:  Delete,
	caps.TableStrs[61]:  Down,
	caps.TableStrs[66]:  F1,
	caps.TableStrs[67]:  F10,
	caps.TableStrs[68]:  F2,
	caps.TableStrs[69]:  F3,
	caps.TableStrs[70]:  F4,
	caps.TableStrs[71]:  F5,
	caps.TableStrs[72]:  F6,
	caps.TableStrs[73]:  F7,
	caps.TableStrs[74]:  F8,
	caps.TableStrs[75]:  F9,
	caps.TableStrs[76]:  Home,
	caps.TableStrs[77]:  Insert,
	caps.TableStrs[79]:  Left,
	caps.TableStrs[81]:  PageDown,
	caps.TableStrs[82]:  PageUp,
	caps.TableStrs[83]:  Right,
	caps.TableStrs[87]:  Up,
	caps.TableStrs[148]: BackTab,
	caps.TableStrs[164]: End,
	caps.TableStrs[165]: Enter,
	caps.TableStrs[191]: ShiftDelete,
	caps.TableStrs[194]: ShiftEnd,
	caps.TableStrs[199]: ShiftHome,
	caps.TableStrs[200]: ShiftInsert,
	caps.TableStrs[201]: ShiftLeft,
	caps.TableStrs[210]: ShiftRight,
	caps.TableStrs[216]: F11,
	caps.TableStrs[217]: F12,
	caps.TableStrs[355]: Mouse,
}

// List of all key sequences we know about. This excludes most obscure ones not
// present on modern devices.
const (
	// Special key used to signal errors.
	UnknownSequence Key = iota + (1 << 32)

	ShiftLeft
	PageUp
	Insert
	ShiftInsert
	Up
	Right
	F1
	ShiftRight
	F2
	ShiftHome
	F3
	Delete
	PageDown
	F4
	F10
	F11
	ShiftDelete
	F5
	Down
	Mouse
	F12
	ShiftEnd
	F6
	Enter
	Left
	F7
	End
	F8
	F9
	Backspace
	BackTab
	Home
)

// Names of named key constants.
var keyNames = map[Key]string{
	ShiftLeft:   `ShiftLeft`,
	PageUp:      `PageUp`,
	Insert:      `Insert`,
	ShiftInsert: `ShiftInsert`,
	Up:          `Up`,
	Right:       `Right`,
	F1:          `F1`,
	ShiftRight:  `ShiftRight`,
	F2:          `F2`,
	ShiftHome:   `ShiftHome`,
	F3:          `F3`,
	Delete:      `Delete`,
	PageDown:    `PageDown`,
	F4:          `F4`,
	F10:         `F10`,
	F11:         `F11`,
	ShiftDelete: `ShiftDelete`,
	F5:          `F5`,
	Down:        `Down`,
	Mouse:       `Mouse`,
	F12:         `F12`,
	ShiftEnd:    `ShiftEnd`,
	F6:          `F6`,
	Enter:       `Enter`,
	Left:        `Left`,
	F7:          `F7`,
	End:         `End`,
	F8:          `F8`,
	F9:          `F9`,
	Backspace:   `Backspace`,
	BackTab:     `BackTab`,
	Home:        `Home`,
}