Command.cs 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393
  1. // 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
  2. using System;
  3. namespace Terminal.Gui {
  4. /// <summary>
  5. /// Actions which can be performed by the application or bound to keys in a <see cref="View"/> control.
  6. /// </summary>
  7. public enum Command {
  8. /// <summary>
  9. /// Moves down one item (cell, line, etc...).
  10. /// </summary>
  11. LineDown,
  12. /// <summary>
  13. /// Extends the selection down one (cell, line, etc...).
  14. /// </summary>
  15. LineDownExtend,
  16. /// <summary>
  17. /// Moves down to the last child node of the branch that holds the current selection.
  18. /// </summary>
  19. LineDownToLastBranch,
  20. /// <summary>
  21. /// Scrolls down one (cell, line, etc...) (without changing the selection).
  22. /// </summary>
  23. ScrollDown,
  24. // --------------------------------------------------------------------
  25. /// <summary>
  26. /// Moves up one (cell, line, etc...).
  27. /// </summary>
  28. LineUp,
  29. /// <summary>
  30. /// Extends the selection up one item (cell, line, etc...).
  31. /// </summary>
  32. LineUpExtend,
  33. /// <summary>
  34. /// Moves up to the first child node of the branch that holds the current selection.
  35. /// </summary>
  36. LineUpToFirstBranch,
  37. /// <summary>
  38. /// Scrolls up one item (cell, line, etc...) (without changing the selection).
  39. /// </summary>
  40. ScrollUp,
  41. /// <summary>
  42. /// Moves the selection left one by the minimum increment supported by the <see cref="View"/> e.g. single character, cell, item etc.
  43. /// </summary>
  44. Left,
  45. /// <summary>
  46. /// Scrolls one item (cell, character, etc...) to the left
  47. /// </summary>
  48. ScrollLeft,
  49. /// <summary>
  50. /// Extends the selection left one by the minimum increment supported by the view e.g. single character, cell, item etc.
  51. /// </summary>
  52. LeftExtend,
  53. /// <summary>
  54. /// Moves the selection right one by the minimum increment supported by the view e.g. single character, cell, item etc.
  55. /// </summary>
  56. Right,
  57. /// <summary>
  58. /// Scrolls one item (cell, character, etc...) to the right.
  59. /// </summary>
  60. ScrollRight,
  61. /// <summary>
  62. /// Extends the selection right one by the minimum increment supported by the view e.g. single character, cell, item etc.
  63. /// </summary>
  64. RightExtend,
  65. /// <summary>
  66. /// Moves the caret to the start of the previous word.
  67. /// </summary>
  68. WordLeft,
  69. /// <summary>
  70. /// Extends the selection to the start of the previous word.
  71. /// </summary>
  72. WordLeftExtend,
  73. /// <summary>
  74. /// Moves the caret to the start of the next word.
  75. /// </summary>
  76. WordRight,
  77. /// <summary>
  78. /// Extends the selection to the start of the next word.
  79. /// </summary>
  80. WordRightExtend,
  81. /// <summary>
  82. /// Cuts to the clipboard the characters from the current position to the end of the line.
  83. /// </summary>
  84. CutToEndLine,
  85. /// <summary>
  86. /// Cuts to the clipboard the characters from the current position to the start of the line.
  87. /// </summary>
  88. CutToStartLine,
  89. /// <summary>
  90. /// Deletes the characters forwards.
  91. /// </summary>
  92. KillWordForwards,
  93. /// <summary>
  94. /// Deletes the characters backwards.
  95. /// </summary>
  96. KillWordBackwards,
  97. /// <summary>
  98. /// Toggles overwrite mode such that newly typed text overwrites the text that is
  99. /// already there (typically associated with the Insert key).
  100. /// </summary>
  101. ToggleOverwrite,
  102. /// <summary>
  103. /// Enables overwrite mode such that newly typed text overwrites the text that is
  104. /// already there (typically associated with the Insert key).
  105. /// </summary>
  106. EnableOverwrite,
  107. /// <summary>
  108. /// Disables overwrite mode (<see cref="EnableOverwrite"/>)
  109. /// </summary>
  110. DisableOverwrite,
  111. /// <summary>
  112. /// Move one page down.
  113. /// </summary>
  114. PageDown,
  115. /// <summary>
  116. /// Move one page page extending the selection to cover revealed objects/characters.
  117. /// </summary>
  118. PageDownExtend,
  119. /// <summary>
  120. /// Move one page up.
  121. /// </summary>
  122. PageUp,
  123. /// <summary>
  124. /// Move one page up extending the selection to cover revealed objects/characters.
  125. /// </summary>
  126. PageUpExtend,
  127. /// <summary>
  128. /// Moves to the top/home.
  129. /// </summary>
  130. TopHome,
  131. /// <summary>
  132. /// Extends the selection to the top/home.
  133. /// </summary>
  134. TopHomeExtend,
  135. /// <summary>
  136. /// Moves to the bottom/end.
  137. /// </summary>
  138. BottomEnd,
  139. /// <summary>
  140. /// Extends the selection to the bottom/end.
  141. /// </summary>
  142. BottomEndExtend,
  143. /// <summary>
  144. /// Open the selected item.
  145. /// </summary>
  146. OpenSelectedItem,
  147. /// <summary>
  148. /// Toggle the checked state.
  149. /// </summary>
  150. ToggleChecked,
  151. /// <summary>
  152. /// Accepts the current state (e.g. selection, button press etc).
  153. /// </summary>
  154. Accept,
  155. /// <summary>
  156. /// Toggles the Expanded or collapsed state of a a list or item (with subitems).
  157. /// </summary>
  158. ToggleExpandCollapse,
  159. /// <summary>
  160. /// Expands a list or item (with subitems).
  161. /// </summary>
  162. Expand,
  163. /// <summary>
  164. /// Recursively Expands all child items and their child items (if any).
  165. /// </summary>
  166. ExpandAll,
  167. /// <summary>
  168. /// Collapses a list or item (with subitems).
  169. /// </summary>
  170. Collapse,
  171. /// <summary>
  172. /// Recursively collapses a list items of their children (if any).
  173. /// </summary>
  174. CollapseAll,
  175. /// <summary>
  176. /// Cancels an action or any temporary states on the control e.g. expanding
  177. /// a combo list.
  178. /// </summary>
  179. Cancel,
  180. /// <summary>
  181. /// Unix emulation.
  182. /// </summary>
  183. UnixEmulation,
  184. /// <summary>
  185. /// Deletes the character on the right.
  186. /// </summary>
  187. DeleteCharRight,
  188. /// <summary>
  189. /// Deletes the character on the left.
  190. /// </summary>
  191. DeleteCharLeft,
  192. /// <summary>
  193. /// Selects all objects.
  194. /// </summary>
  195. SelectAll,
  196. /// <summary>
  197. /// Deletes all objects.
  198. /// </summary>
  199. DeleteAll,
  200. /// <summary>
  201. /// Moves the cursor to the start of line.
  202. /// </summary>
  203. StartOfLine,
  204. /// <summary>
  205. /// Extends the selection to the start of line.
  206. /// </summary>
  207. StartOfLineExtend,
  208. /// <summary>
  209. /// Moves the cursor to the end of line.
  210. /// </summary>
  211. EndOfLine,
  212. /// <summary>
  213. /// Extends the selection to the end of line.
  214. /// </summary>
  215. EndOfLineExtend,
  216. /// <summary>
  217. /// Moves the cursor to the top of page.
  218. /// </summary>
  219. StartOfPage,
  220. /// <summary>
  221. /// Moves the cursor to the bottom of page.
  222. /// </summary>
  223. EndOfPage,
  224. /// <summary>
  225. /// Moves to the left page.
  226. /// </summary>
  227. PageLeft,
  228. /// <summary>
  229. /// Moves to the right page.
  230. /// </summary>
  231. PageRight,
  232. /// <summary>
  233. /// Moves to the left begin.
  234. /// </summary>
  235. LeftHome,
  236. /// <summary>
  237. /// Extends the selection to the left begin.
  238. /// </summary>
  239. LeftHomeExtend,
  240. /// <summary>
  241. /// Moves to the right end.
  242. /// </summary>
  243. RightEnd,
  244. /// <summary>
  245. /// Extends the selection to the right end.
  246. /// </summary>
  247. RightEndExtend,
  248. /// <summary>
  249. /// Undo changes.
  250. /// </summary>
  251. Undo,
  252. /// <summary>
  253. /// Redo changes.
  254. /// </summary>
  255. Redo,
  256. /// <summary>
  257. /// Copies the current selection.
  258. /// </summary>
  259. Copy,
  260. /// <summary>
  261. /// Cuts the current selection.
  262. /// </summary>
  263. Cut,
  264. /// <summary>
  265. /// Pastes the current selection.
  266. /// </summary>
  267. Paste,
  268. /// <summary>
  269. /// Quit a <see cref="Toplevel"/>.
  270. /// </summary>
  271. QuitToplevel,
  272. /// <summary>
  273. /// Suspend a application (used on Linux).
  274. /// </summary>
  275. Suspend,
  276. /// <summary>
  277. /// Moves focus to the next view.
  278. /// </summary>
  279. NextView,
  280. /// <summary>
  281. /// Moves focuss to the previous view.
  282. /// </summary>
  283. PreviousView,
  284. /// <summary>
  285. /// Moves focus to the next view or toplevel (case of MDI).
  286. /// </summary>
  287. NextViewOrTop,
  288. /// <summary>
  289. /// Moves focus to the next previous or toplevel (case of MDI).
  290. /// </summary>
  291. PreviousViewOrTop,
  292. /// <summary>
  293. /// Refresh.
  294. /// </summary>
  295. Refresh,
  296. /// <summary>
  297. /// Toggles the selection.
  298. /// </summary>
  299. ToggleExtend,
  300. /// <summary>
  301. /// Inserts a new item.
  302. /// </summary>
  303. NewLine,
  304. /// <summary>
  305. /// Tabs to the next item.
  306. /// </summary>
  307. Tab,
  308. /// <summary>
  309. /// Tabs back to the previous item.
  310. /// </summary>
  311. BackTab
  312. }
  313. }