-
Notifications
You must be signed in to change notification settings - Fork 673
/
Command.cs
393 lines (313 loc) · 8.12 KB
/
Command.cs
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
// These classes use a keybinding system based on the design implemented in Scintilla.Net which is an MIT licensed open source project https://github.com/jacobslusser/ScintillaNET/blob/master/src/ScintillaNET/Command.cs
using System;
namespace Terminal.Gui {
/// <summary>
/// Actions which can be performed by the application or bound to keys in a <see cref="View"/> control.
/// </summary>
public enum Command {
/// <summary>
/// Moves down one item (cell, line, etc...).
/// </summary>
LineDown,
/// <summary>
/// Extends the selection down one (cell, line, etc...).
/// </summary>
LineDownExtend,
/// <summary>
/// Moves down to the last child node of the branch that holds the current selection.
/// </summary>
LineDownToLastBranch,
/// <summary>
/// Scrolls down one (cell, line, etc...) (without changing the selection).
/// </summary>
ScrollDown,
// --------------------------------------------------------------------
/// <summary>
/// Moves up one (cell, line, etc...).
/// </summary>
LineUp,
/// <summary>
/// Extends the selection up one item (cell, line, etc...).
/// </summary>
LineUpExtend,
/// <summary>
/// Moves up to the first child node of the branch that holds the current selection.
/// </summary>
LineUpToFirstBranch,
/// <summary>
/// Scrolls up one item (cell, line, etc...) (without changing the selection).
/// </summary>
ScrollUp,
/// <summary>
/// Moves the selection left one by the minimum increment supported by the <see cref="View"/> e.g. single character, cell, item etc.
/// </summary>
Left,
/// <summary>
/// Scrolls one item (cell, character, etc...) to the left
/// </summary>
ScrollLeft,
/// <summary>
/// Extends the selection left one by the minimum increment supported by the view e.g. single character, cell, item etc.
/// </summary>
LeftExtend,
/// <summary>
/// Moves the selection right one by the minimum increment supported by the view e.g. single character, cell, item etc.
/// </summary>
Right,
/// <summary>
/// Scrolls one item (cell, character, etc...) to the right.
/// </summary>
ScrollRight,
/// <summary>
/// Extends the selection right one by the minimum increment supported by the view e.g. single character, cell, item etc.
/// </summary>
RightExtend,
/// <summary>
/// Moves the caret to the start of the previous word.
/// </summary>
WordLeft,
/// <summary>
/// Extends the selection to the start of the previous word.
/// </summary>
WordLeftExtend,
/// <summary>
/// Moves the caret to the start of the next word.
/// </summary>
WordRight,
/// <summary>
/// Extends the selection to the start of the next word.
/// </summary>
WordRightExtend,
/// <summary>
/// Cuts to the clipboard the characters from the current position to the end of the line.
/// </summary>
CutToEndLine,
/// <summary>
/// Cuts to the clipboard the characters from the current position to the start of the line.
/// </summary>
CutToStartLine,
/// <summary>
/// Deletes the characters forwards.
/// </summary>
KillWordForwards,
/// <summary>
/// Deletes the characters backwards.
/// </summary>
KillWordBackwards,
/// <summary>
/// Toggles overwrite mode such that newly typed text overwrites the text that is
/// already there (typically associated with the Insert key).
/// </summary>
ToggleOverwrite,
/// <summary>
/// Enables overwrite mode such that newly typed text overwrites the text that is
/// already there (typically associated with the Insert key).
/// </summary>
EnableOverwrite,
/// <summary>
/// Disables overwrite mode (<see cref="EnableOverwrite"/>)
/// </summary>
DisableOverwrite,
/// <summary>
/// Move one page down.
/// </summary>
PageDown,
/// <summary>
/// Move one page page extending the selection to cover revealed objects/characters.
/// </summary>
PageDownExtend,
/// <summary>
/// Move one page up.
/// </summary>
PageUp,
/// <summary>
/// Move one page up extending the selection to cover revealed objects/characters.
/// </summary>
PageUpExtend,
/// <summary>
/// Moves to the top/home.
/// </summary>
TopHome,
/// <summary>
/// Extends the selection to the top/home.
/// </summary>
TopHomeExtend,
/// <summary>
/// Moves to the bottom/end.
/// </summary>
BottomEnd,
/// <summary>
/// Extends the selection to the bottom/end.
/// </summary>
BottomEndExtend,
/// <summary>
/// Open the selected item.
/// </summary>
OpenSelectedItem,
/// <summary>
/// Toggle the checked state.
/// </summary>
ToggleChecked,
/// <summary>
/// Accepts the current state (e.g. selection, button press etc).
/// </summary>
Accept,
/// <summary>
/// Toggles the Expanded or collapsed state of a a list or item (with subitems).
/// </summary>
ToggleExpandCollapse,
/// <summary>
/// Expands a list or item (with subitems).
/// </summary>
Expand,
/// <summary>
/// Recursively Expands all child items and their child items (if any).
/// </summary>
ExpandAll,
/// <summary>
/// Collapses a list or item (with subitems).
/// </summary>
Collapse,
/// <summary>
/// Recursively collapses a list items of their children (if any).
/// </summary>
CollapseAll,
/// <summary>
/// Cancels an action or any temporary states on the control e.g. expanding
/// a combo list.
/// </summary>
Cancel,
/// <summary>
/// Unix emulation.
/// </summary>
UnixEmulation,
/// <summary>
/// Deletes the character on the right.
/// </summary>
DeleteCharRight,
/// <summary>
/// Deletes the character on the left.
/// </summary>
DeleteCharLeft,
/// <summary>
/// Selects all objects.
/// </summary>
SelectAll,
/// <summary>
/// Deletes all objects.
/// </summary>
DeleteAll,
/// <summary>
/// Moves the cursor to the start of line.
/// </summary>
StartOfLine,
/// <summary>
/// Extends the selection to the start of line.
/// </summary>
StartOfLineExtend,
/// <summary>
/// Moves the cursor to the end of line.
/// </summary>
EndOfLine,
/// <summary>
/// Extends the selection to the end of line.
/// </summary>
EndOfLineExtend,
/// <summary>
/// Moves the cursor to the top of page.
/// </summary>
StartOfPage,
/// <summary>
/// Moves the cursor to the bottom of page.
/// </summary>
EndOfPage,
/// <summary>
/// Moves to the left page.
/// </summary>
PageLeft,
/// <summary>
/// Moves to the right page.
/// </summary>
PageRight,
/// <summary>
/// Moves to the left begin.
/// </summary>
LeftHome,
/// <summary>
/// Extends the selection to the left begin.
/// </summary>
LeftHomeExtend,
/// <summary>
/// Moves to the right end.
/// </summary>
RightEnd,
/// <summary>
/// Extends the selection to the right end.
/// </summary>
RightEndExtend,
/// <summary>
/// Undo changes.
/// </summary>
Undo,
/// <summary>
/// Redo changes.
/// </summary>
Redo,
/// <summary>
/// Copies the current selection.
/// </summary>
Copy,
/// <summary>
/// Cuts the current selection.
/// </summary>
Cut,
/// <summary>
/// Pastes the current selection.
/// </summary>
Paste,
/// <summary>
/// Quit a <see cref="Toplevel"/>.
/// </summary>
QuitToplevel,
/// <summary>
/// Suspend a application (used on Linux).
/// </summary>
Suspend,
/// <summary>
/// Moves focus to the next view.
/// </summary>
NextView,
/// <summary>
/// Moves focuss to the previous view.
/// </summary>
PreviousView,
/// <summary>
/// Moves focus to the next view or toplevel (case of MDI).
/// </summary>
NextViewOrTop,
/// <summary>
/// Moves focus to the next previous or toplevel (case of MDI).
/// </summary>
PreviousViewOrTop,
/// <summary>
/// Refresh.
/// </summary>
Refresh,
/// <summary>
/// Toggles the selection.
/// </summary>
ToggleExtend,
/// <summary>
/// Inserts a new item.
/// </summary>
NewLine,
/// <summary>
/// Tabs to the next item.
/// </summary>
Tab,
/// <summary>
/// Tabs back to the previous item.
/// </summary>
BackTab
}
}