keys.lua 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. local keycode={
  2. ["space"]=32,
  3. ["apostrophe"]=39,
  4. ["comma"]=44,
  5. ["minus"]=45,
  6. ["period"]=46,
  7. ["slash"]=47,
  8. ["0"]=48,
  9. ["1"]=49,
  10. ["2"]=50,
  11. ["3"]=51,
  12. ["4"]=52,
  13. ["5"]=53,
  14. ["6"]=54,
  15. ["7"]=55,
  16. ["8"]=56,
  17. ["9"]=57,
  18. ["semicolon"]=59,
  19. ["equal"]=61,
  20. ["a"]=65,
  21. ["b"]=66,
  22. ["c"]=67,
  23. ["d"]=68,
  24. ["e"]=69,
  25. ["f"]=70,
  26. ["g"]=71,
  27. ["h"]=72,
  28. ["i"]=73,
  29. ["j"]=74,
  30. ["k"]=75,
  31. ["l"]=76,
  32. ["m"]=77,
  33. ["n"]=78,
  34. ["o"]=79,
  35. ["p"]=80,
  36. ["q"]=81,
  37. ["r"]=82,
  38. ["s"]=83,
  39. ["t"]=84,
  40. ["u"]=85,
  41. ["v"]=86,
  42. ["w"]=87,
  43. ["x"]=88,
  44. ["y"]=89,
  45. ["z"]=90,
  46. ["left_bracket"]=91,
  47. ["backslash"]=92,
  48. ["right_bracket"]=93,
  49. ["grave_accent"]=96,
  50. ["world_1"]=161,
  51. ["world_2"]=162,
  52. ["escape"]=256,
  53. ["enter"]=257,
  54. ["tab"]=258,
  55. ["backspace"]=259,
  56. ["insert"]=260,
  57. ["delete"]=261,
  58. ["right"]=262,
  59. ["left"]=263,
  60. ["down"]=264,
  61. ["up"]=265,
  62. ["page_up"]=266,
  63. ["page_down"]=267,
  64. ["home"]=268,
  65. ["end"]=269,
  66. ["caps_lock"]=280,
  67. ["scroll_lock"]=281,
  68. ["num_lock"]=282,
  69. ["print_screen"]=283,
  70. ["pause"]=284,
  71. ["f1"]=290,
  72. ["f2"]=291,
  73. ["f3"]=292,
  74. ["f4"]=293,
  75. ["f5"]=294,
  76. ["f6"]=295,
  77. ["f7"]=296,
  78. ["f8"]=297,
  79. ["f9"]=298,
  80. ["f10"]=299,
  81. ["f11"]=300,
  82. ["f12"]=301,
  83. ["f13"]=302,
  84. ["f14"]=303,
  85. ["f15"]=304,
  86. ["f16"]=305,
  87. ["f17"]=306,
  88. ["f18"]=307,
  89. ["f19"]=308,
  90. ["f20"]=309,
  91. ["f21"]=310,
  92. ["f22"]=311,
  93. ["f23"]=312,
  94. ["f24"]=313,
  95. ["f25"]=314,
  96. ["kp_0"]=320,
  97. ["kp_1"]=321,
  98. ["kp_2"]=322,
  99. ["kp_3"]=323,
  100. ["kp_4"]=324,
  101. ["kp_5"]=325,
  102. ["kp_6"]=326,
  103. ["kp_7"]=327,
  104. ["kp_8"]=328,
  105. ["kp_9"]=329,
  106. ["kp_decimal"]=330,
  107. ["kp_divide"]=331,
  108. ["kp_multiply"]=332,
  109. ["kp_subtract"]=333,
  110. ["kp_add"]=334,
  111. ["kp_enter"]=335,
  112. ["kp_equal"]=336,
  113. ["left_shift"]=340,
  114. ["left_control"]=341,
  115. ["left_alt"]=342,
  116. ["left_super"]=343,
  117. ["right_shift"]=344,
  118. ["right_control"]=345,
  119. ["right_alt"]=346,
  120. ["right_super"]=347,
  121. ["menu"]=348}
  122. local keyname={}
  123. for i,v in pairs(keycode) do
  124. keyname[v]=i
  125. end
  126. return {keycode,keyname}