keycode.go 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. package keycode
  2. // Keyboard constants for use with Zori
  3. // Your backend should map it's key codes to these.
  4. const (
  5. /* Note: these values are deliberately the same as in Allegro */
  6. KEY_A = 1
  7. KEY_B = 2
  8. KEY_C = 3
  9. KEY_D = 4
  10. KEY_E = 5
  11. KEY_F = 6
  12. KEY_G = 7
  13. KEY_H = 8
  14. KEY_I = 9
  15. KEY_J = 10
  16. KEY_K = 11
  17. KEY_L = 12
  18. KEY_M = 13
  19. KEY_N = 14
  20. KEY_O = 15
  21. KEY_P = 16
  22. KEY_Q = 17
  23. KEY_R = 18
  24. KEY_S = 19
  25. KEY_T = 20
  26. KEY_U = 21
  27. KEY_V = 22
  28. KEY_W = 23
  29. KEY_X = 24
  30. KEY_Y = 25
  31. KEY_Z = 26
  32. KEY_0 = 27
  33. KEY_1 = 28
  34. KEY_2 = 29
  35. KEY_3 = 30
  36. KEY_4 = 31
  37. KEY_5 = 32
  38. KEY_6 = 33
  39. KEY_7 = 34
  40. KEY_8 = 35
  41. KEY_9 = 36
  42. KEY_PAD_0 = 37
  43. KEY_PAD_1 = 38
  44. KEY_PAD_2 = 39
  45. KEY_PAD_3 = 40
  46. KEY_PAD_4 = 41
  47. KEY_PAD_5 = 42
  48. KEY_PAD_6 = 43
  49. KEY_PAD_7 = 44
  50. KEY_PAD_8 = 45
  51. KEY_PAD_9 = 46
  52. KEY_F1 = 47
  53. KEY_F2 = 48
  54. KEY_F3 = 49
  55. KEY_F4 = 50
  56. KEY_F5 = 51
  57. KEY_F6 = 52
  58. KEY_F7 = 53
  59. KEY_F8 = 54
  60. KEY_F9 = 55
  61. KEY_F10 = 56
  62. KEY_F11 = 57
  63. KEY_F12 = 58
  64. KEY_ESCAPE = 59
  65. KEY_TILDE = 60
  66. KEY_MINUS = 61
  67. KEY_EQUALS = 62
  68. KEY_BACKSPACE = 63
  69. KEY_TAB = 64
  70. KEY_OPENBRACE = 65
  71. KEY_CLOSEBRACE = 66
  72. KEY_ENTER = 67
  73. KEY_SEMICOLON = 68
  74. KEY_QUOTE = 69
  75. KEY_BACKSLASH = 70
  76. KEY_BACKSLASH2 = 71
  77. KEY_COMMA = 72
  78. KEY_FULLSTOP = 73
  79. KEY_SLASH = 74
  80. KEY_SPACE = 75
  81. KEY_INSERT = 76
  82. KEY_DELETE = 77
  83. KEY_HOME = 78
  84. KEY_END = 79
  85. KEY_PGUP = 80
  86. KEY_PGDN = 81
  87. KEY_LEFT = 82
  88. KEY_RIGHT = 83
  89. KEY_UP = 84
  90. KEY_DOWN = 85
  91. KEY_PAD_SLASH = 86
  92. KEY_PAD_ASTERISK = 87
  93. KEY_PAD_MINUS = 88
  94. KEY_PAD_PLUS = 89
  95. KEY_PAD_DELETE = 90
  96. KEY_PAD_ENTER = 91
  97. KEY_PRINTSCREEN = 92
  98. KEY_PAUSE = 93
  99. KEY_ABNT_C1 = 94
  100. KEY_YEN = 95
  101. KEY_KANA = 96
  102. KEY_CONVERT = 97
  103. KEY_NOCONVERT = 98
  104. KEY_AT = 99
  105. KEY_CIRCUMFLEX = 100
  106. KEY_COLON2 = 101
  107. KEY_KANJI = 102
  108. KEY_PAD_EQUALS = 103
  109. KEY_BACKQUOTE = 104
  110. KEY_SEMICOLON2 = 105
  111. KEY_COMMAND = 106
  112. KEY_BACK = 107
  113. KEY_VOLUME_UP = 108
  114. KEY_VOLUME_DOWN = 109
  115. KEY_SEARCH = 110
  116. KEY_DPAD_CENTER = 111
  117. KEY_BUTTON_X = 112
  118. KEY_BUTTON_Y = 113
  119. KEY_DPAD_UP = 114
  120. KEY_DPAD_DOWN = 115
  121. KEY_DPAD_LEFT = 116
  122. KEY_DPAD_RIGHT = 117
  123. KEY_SELECT = 118
  124. KEY_START = 119
  125. KEY_BUTTON_L1 = 120
  126. KEY_BUTTON_R1 = 121
  127. KEY_BUTTON_L2 = 122
  128. KEY_BUTTON_R2 = 123
  129. KEY_BUTTON_A = 124
  130. KEY_BUTTON_B = 125
  131. KEY_THUMBL = 126
  132. KEY_THUMBR = 127
  133. KEY_UNKNOWN = 128
  134. KEY_MODIFIERS = 215
  135. KEY_LSHIFT = 215
  136. KEY_RSHIFT = 216
  137. KEY_LCTRL = 217
  138. KEY_RCTRL = 218
  139. KEY_ALT = 219
  140. KEY_ALTGR = 220
  141. KEY_LWIN = 221
  142. KEY_RWIN = 222
  143. KEY_MENU = 223
  144. KEY_SCROLLLOCK = 224
  145. KEY_NUMLOCK = 225
  146. KEY_CAPSLOCK = 226
  147. KEY_MAX
  148. )
  149. const(
  150. KEYMOD_SHIFT = 0x00001
  151. KEYMOD_CTRL = 0x00002
  152. KEYMOD_ALT = 0x00004
  153. KEYMOD_LWIN = 0x00008
  154. KEYMOD_RWIN = 0x00010
  155. KEYMOD_MENU = 0x00020
  156. KEYMOD_ALTGR = 0x00040
  157. KEYMOD_COMMAND = 0x00080
  158. KEYMOD_SCROLLLOCK = 0x00100
  159. KEYMOD_NUMLOCK = 0x00200
  160. KEYMOD_CAPSLOCK = 0x00400
  161. KEYMOD_INALTSEQ = 0x00800
  162. KEYMOD_ACCENT1 = 0x01000
  163. KEYMOD_ACCENT2 = 0x02000
  164. KEYMOD_ACCENT3 = 0x04000
  165. KEYMOD_ACCENT4 = 0x08000
  166. )