key.go 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. package fyne
  2. // KeyName represents the name of a key that has been pressed.
  3. type KeyName string
  4. const (
  5. // KeyEscape is the "esc" key
  6. KeyEscape KeyName = "Escape"
  7. // KeyReturn is the carriage return (main keyboard)
  8. KeyReturn KeyName = "Return"
  9. // KeyTab is the tab advance key
  10. KeyTab KeyName = "Tab"
  11. // KeyBackspace is the delete-before-cursor key
  12. KeyBackspace KeyName = "BackSpace"
  13. // KeyInsert is the insert mode key
  14. KeyInsert KeyName = "Insert"
  15. // KeyDelete is the delete-after-cursor key
  16. KeyDelete KeyName = "Delete"
  17. // KeyRight is the right arrow key
  18. KeyRight KeyName = "Right"
  19. // KeyLeft is the left arrow key
  20. KeyLeft KeyName = "Left"
  21. // KeyDown is the down arrow key
  22. KeyDown KeyName = "Down"
  23. // KeyUp is the up arrow key
  24. KeyUp KeyName = "Up"
  25. // KeyPageUp is the page up num-pad key
  26. KeyPageUp KeyName = "Prior"
  27. // KeyPageDown is the page down num-pad key
  28. KeyPageDown KeyName = "Next"
  29. // KeyHome is the line-home key
  30. KeyHome KeyName = "Home"
  31. // KeyEnd is the line-end key
  32. KeyEnd KeyName = "End"
  33. // KeyF1 is the first function key
  34. KeyF1 KeyName = "F1"
  35. // KeyF2 is the second function key
  36. KeyF2 KeyName = "F2"
  37. // KeyF3 is the third function key
  38. KeyF3 KeyName = "F3"
  39. // KeyF4 is the fourth function key
  40. KeyF4 KeyName = "F4"
  41. // KeyF5 is the fifth function key
  42. KeyF5 KeyName = "F5"
  43. // KeyF6 is the sixth function key
  44. KeyF6 KeyName = "F6"
  45. // KeyF7 is the seventh function key
  46. KeyF7 KeyName = "F7"
  47. // KeyF8 is the eighth function key
  48. KeyF8 KeyName = "F8"
  49. // KeyF9 is the ninth function key
  50. KeyF9 KeyName = "F9"
  51. // KeyF10 is the tenth function key
  52. KeyF10 KeyName = "F10"
  53. // KeyF11 is the eleventh function key
  54. KeyF11 KeyName = "F11"
  55. // KeyF12 is the twelfth function key
  56. KeyF12 KeyName = "F12"
  57. /*
  58. F13
  59. ...
  60. F25
  61. */
  62. // KeyEnter is the enter/ return key (keypad)
  63. KeyEnter KeyName = "KP_Enter"
  64. // Key0 represents the key 0
  65. Key0 KeyName = "0"
  66. // Key1 represents the key 1
  67. Key1 KeyName = "1"
  68. // Key2 represents the key 2
  69. Key2 KeyName = "2"
  70. // Key3 represents the key 3
  71. Key3 KeyName = "3"
  72. // Key4 represents the key 4
  73. Key4 KeyName = "4"
  74. // Key5 represents the key 5
  75. Key5 KeyName = "5"
  76. // Key6 represents the key 6
  77. Key6 KeyName = "6"
  78. // Key7 represents the key 7
  79. Key7 KeyName = "7"
  80. // Key8 represents the key 8
  81. Key8 KeyName = "8"
  82. // Key9 represents the key 9
  83. Key9 KeyName = "9"
  84. // KeyA represents the key A
  85. KeyA KeyName = "A"
  86. // KeyB represents the key B
  87. KeyB KeyName = "B"
  88. // KeyC represents the key C
  89. KeyC KeyName = "C"
  90. // KeyD represents the key D
  91. KeyD KeyName = "D"
  92. // KeyE represents the key E
  93. KeyE KeyName = "E"
  94. // KeyF represents the key F
  95. KeyF KeyName = "F"
  96. // KeyG represents the key G
  97. KeyG KeyName = "G"
  98. // KeyH represents the key H
  99. KeyH KeyName = "H"
  100. // KeyI represents the key I
  101. KeyI KeyName = "I"
  102. // KeyJ represents the key J
  103. KeyJ KeyName = "J"
  104. // KeyK represents the key K
  105. KeyK KeyName = "K"
  106. // KeyL represents the key L
  107. KeyL KeyName = "L"
  108. // KeyM represents the key M
  109. KeyM KeyName = "M"
  110. // KeyN represents the key N
  111. KeyN KeyName = "N"
  112. // KeyO represents the key O
  113. KeyO KeyName = "O"
  114. // KeyP represents the key P
  115. KeyP KeyName = "P"
  116. // KeyQ represents the key Q
  117. KeyQ KeyName = "Q"
  118. // KeyR represents the key R
  119. KeyR KeyName = "R"
  120. // KeyS represents the key S
  121. KeyS KeyName = "S"
  122. // KeyT represents the key T
  123. KeyT KeyName = "T"
  124. // KeyU represents the key U
  125. KeyU KeyName = "U"
  126. // KeyV represents the key V
  127. KeyV KeyName = "V"
  128. // KeyW represents the key W
  129. KeyW KeyName = "W"
  130. // KeyX represents the key X
  131. KeyX KeyName = "X"
  132. // KeyY represents the key Y
  133. KeyY KeyName = "Y"
  134. // KeyZ represents the key Z
  135. KeyZ KeyName = "Z"
  136. // KeySpace is the space key
  137. KeySpace KeyName = "Space"
  138. // KeyApostrophe is the key "'"
  139. KeyApostrophe KeyName = "'"
  140. // KeyComma is the key ","
  141. KeyComma KeyName = ","
  142. // KeyMinus is the key "-"
  143. KeyMinus KeyName = "-"
  144. // KeyPeriod is the key "." (full stop)
  145. KeyPeriod KeyName = "."
  146. // KeySlash is the key "/"
  147. KeySlash KeyName = "/"
  148. // KeyBackslash is the key "\"
  149. KeyBackslash KeyName = "\\"
  150. // KeyLeftBracket is the key "["
  151. KeyLeftBracket KeyName = "["
  152. // KeyRightBracket is the key "]"
  153. KeyRightBracket KeyName = "]"
  154. // KeySemicolon is the key ";"
  155. KeySemicolon KeyName = ";"
  156. // KeyEqual is the key "="
  157. KeyEqual KeyName = "="
  158. // KeyAsterisk is the keypad key "*"
  159. KeyAsterisk KeyName = "*"
  160. // KeyPlus is the keypad key "+"
  161. KeyPlus KeyName = "+"
  162. // KeyBackTick is the key "`" on a US keyboard
  163. KeyBackTick KeyName = "`"
  164. // KeyUnknown is used for key events where the underlying hardware generated an
  165. // event that Fyne could not decode.
  166. //
  167. // Since: 2.1
  168. KeyUnknown KeyName = ""
  169. )
  170. // KeyModifier represents any modifier key (shift etc.) that is being pressed together with a key.
  171. //
  172. // Since: 2.2
  173. type KeyModifier int
  174. const (
  175. // KeyModifierShift represents a shift key being held
  176. //
  177. // Since: 2.2
  178. KeyModifierShift KeyModifier = 1 << iota
  179. // KeyModifierControl represents the ctrl key being held
  180. //
  181. // Since: 2.2
  182. KeyModifierControl
  183. // KeyModifierAlt represents either alt keys being held
  184. //
  185. // Since: 2.2
  186. KeyModifierAlt
  187. // KeyModifierSuper represents either super keys being held
  188. //
  189. // Since: 2.2
  190. KeyModifierSuper
  191. )