keycode.rb 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. # Constants for the keyboard input
  2. # Key code constants
  3. KEY_A = 1
  4. KEY_B = 2
  5. KEY_C = 3
  6. KEY_D = 4
  7. KEY_E = 5
  8. KEY_F = 6
  9. KEY_G = 7
  10. KEY_H = 8
  11. KEY_I = 9
  12. KEY_J = 10
  13. KEY_K = 11
  14. KEY_L = 12
  15. KEY_M = 13
  16. KEY_N = 14
  17. KEY_O = 15
  18. KEY_P = 16
  19. KEY_Q = 17
  20. KEY_R = 18
  21. KEY_S = 19
  22. KEY_T = 20
  23. KEY_U = 21
  24. KEY_V = 22
  25. KEY_W = 23
  26. KEY_X = 24
  27. KEY_Y = 25
  28. KEY_Z = 26
  29. KEY_0 = 27
  30. KEY_1 = 28
  31. KEY_2 = 29
  32. KEY_3 = 30
  33. KEY_4 = 31
  34. KEY_5 = 32
  35. KEY_6 = 33
  36. KEY_7 = 34
  37. KEY_8 = 35
  38. KEY_9 = 36
  39. KEY_PAD_0 = 37
  40. KEY_PAD_1 = 38
  41. KEY_PAD_2 = 39
  42. KEY_PAD_3 = 40
  43. KEY_PAD_4 = 41
  44. KEY_PAD_5 = 42
  45. KEY_PAD_6 = 43
  46. KEY_PAD_7 = 44
  47. KEY_PAD_8 = 45
  48. KEY_PAD_9 = 46
  49. KEY_F1 = 47
  50. KEY_F2 = 48
  51. KEY_F3 = 49
  52. KEY_F4 = 50
  53. KEY_F5 = 51
  54. KEY_F6 = 52
  55. KEY_F7 = 53
  56. KEY_F8 = 54
  57. KEY_F9 = 55
  58. KEY_F10 = 56
  59. KEY_F11 = 57
  60. KEY_F12 = 58
  61. KEY_ESCAPE = 59
  62. KEY_TILDE = 60
  63. KEY_MINUS = 61
  64. KEY_EQUALS = 62
  65. KEY_BACKSPACE = 63
  66. KEY_TAB = 64
  67. KEY_OPENBRACE = 65
  68. KEY_CLOSEBRACE = 66
  69. KEY_ENTER = 67
  70. KEY_SEMICOLON = 68
  71. KEY_QUOTE = 69
  72. KEY_BACKSLASH = 70
  73. KEY_BACKSLASH2 = 71
  74. KEY_COMMA = 72
  75. KEY_FULLSTOP = 73
  76. KEY_SLASH = 74
  77. KEY_SPACE = 75
  78. KEY_INSERT = 76
  79. KEY_DELETE = 77
  80. KEY_HOME = 78
  81. KEY_END = 79
  82. KEY_PGUP = 80
  83. KEY_PGDN = 81
  84. KEY_LEFT = 82
  85. KEY_RIGHT = 83
  86. KEY_UP = 84
  87. KEY_DOWN = 85
  88. KEY_PAD_SLASH = 86
  89. KEY_PAD_ASTERISK = 87
  90. KEY_PAD_MINUS = 88
  91. KEY_PAD_PLUS = 89
  92. KEY_PAD_DELETE = 90
  93. KEY_PAD_ENTER = 91
  94. KEY_PRINTSCREEN = 92
  95. KEY_PAUSE = 93
  96. KEY_ABNT_C1 = 94
  97. KEY_YEN = 95
  98. KEY_KANA = 96
  99. KEY_CONVERT = 97
  100. KEY_NOCONVERT = 98
  101. KEY_AT = 99
  102. KEY_CIRCUMFLEX = 100
  103. KEY_COLON2 = 101
  104. KEY_KANJI = 102
  105. KEY_PAD_EQUALS = 103
  106. KEY_BACKQUOTE = 104
  107. KEY_SEMICOLON2 = 105
  108. KEY_COMMAND = 106
  109. KEY_BACK = 107
  110. KEY_VOLUME_UP = 108
  111. KEY_VOLUME_DOWN = 109
  112. KEY_UNKNOWN = 110
  113. KEY_MODIFIERS = 215
  114. KEY_LSHIFT = 215
  115. KEY_RSHIFT = 216
  116. KEY_LCTRL = 217
  117. KEY_RCTRL = 218
  118. KEY_ALT = 219
  119. KEY_ALTGR = 220
  120. KEY_LWIN = 221
  121. KEY_RWIN = 222
  122. KEY_MENU = 223
  123. KEY_SCROLLLOCK = 224
  124. KEY_NUMLOCK = 225
  125. KEY_CAPSLOCK = 226
  126. # Key modifiers
  127. KEYMOD_SHIFT = 0x00001
  128. KEYMOD_CTRL = 0x00002
  129. KEYMOD_ALT = 0x00004
  130. KEYMOD_LWIN = 0x00008
  131. KEYMOD_RWIN = 0x00010
  132. KEYMOD_MENU = 0x00020
  133. KEYMOD_ALTGR = 0x00040
  134. KEYMOD_COMMAND = 0x00080
  135. KEYMOD_SCROLLLOCK = 0x00100
  136. KEYMOD_NUMLOCK = 0x00200
  137. KEYMOD_CAPSLOCK = 0x00400
  138. KEYMOD_INALTSEQ = 0x00800
  139. KEYMOD_ACCENT1 = 0x01000
  140. KEYMOD_ACCENT2 = 0x02000
  141. KEYMOD_ACCENT3 = 0x04000
  142. KEYMOD_ACCENT4 = 0x08000