1
0

input.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. /******************************************************************************
  2. Copyright (C) 2013 by Hugh Bailey <[email protected]>
  3. This program is free software: you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation, either version 2 of the License, or
  6. (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program. If not, see <http://www.gnu.org/licenses/>.
  13. ******************************************************************************/
  14. #pragma once
  15. /* TODO: incomplete/may not be necessary */
  16. #ifdef __cplusplus
  17. extern "C" {
  18. #endif
  19. #define KBC_ESCAPE 0x0
  20. #define KBC_1 0x1
  21. #define KBC_2 0x2
  22. #define KBC_3 0x3
  23. #define KBC_4 0x4
  24. #define KBC_5 0x5
  25. #define KBC_6 0x6
  26. #define KBC_7 0x7
  27. #define KBC_8 0x8
  28. #define KBC_9 0x9
  29. #define KBC_0 0xA
  30. #define KBC_MINUS 0xB
  31. #define KBC_EQUALS 0xC
  32. #define KBC_BACK 0xD
  33. #define KBC_TAB 0xE
  34. #define KBC_Q 0xF
  35. #define KBC_W 0x10
  36. #define KBC_E 0x11
  37. #define KBC_R 0x12
  38. #define KBC_T 0x13
  39. #define KBC_Y 0x14
  40. #define KBC_U 0x15
  41. #define KBC_I 0x16
  42. #define KBC_O 0x17
  43. #define KBC_P 0x18
  44. #define KBC_LBRACKET 0x19
  45. #define KBC_RBRACKET 0x1A
  46. #define KBC_RETURN 0x1B
  47. #define KBC_LCONTROL 0x1C
  48. #define KBC_A 0x1D
  49. #define KBC_S 0x1E
  50. #define KBC_D 0x1F
  51. #define KBC_F 0x20
  52. #define KBC_G 0x21
  53. #define KBC_H 0x22
  54. #define KBC_J 0x23
  55. #define KBC_K 0x24
  56. #define KBC_L 0x25
  57. #define KBC_SEMICOLON 0x26
  58. #define KBC_APOSTROPHE 0x27
  59. #define KBC_TILDE 0x28
  60. #define KBC_LSHIFT 0x29
  61. #define KBC_BACKSLASH 0x2A
  62. #define KBC_Z 0x2B
  63. #define KBC_X 0x2C
  64. #define KBC_C 0x2D
  65. #define KBC_V 0x2E
  66. #define KBC_B 0x2F
  67. #define KBC_N 0x30
  68. #define KBC_M 0x31
  69. #define KBC_COMMA 0x32
  70. #define KBC_PERIOD 0x33
  71. #define KBC_SLASH 0x34
  72. #define KBC_RSHIFT 0x35
  73. #define KBC_MULTIPLY 0x36
  74. #define KBC_LALT 0x37
  75. #define KBC_SPACE 0x38
  76. #define KBC_CAPSLOCK 0x39
  77. #define KBC_F1 0x3A
  78. #define KBC_F2 0x3B
  79. #define KBC_F3 0x3C
  80. #define KBC_F4 0x3D
  81. #define KBC_F5 0x3E
  82. #define KBC_F6 0x3F
  83. #define KBC_F7 0x40
  84. #define KBC_F8 0x41
  85. #define KBC_F9 0x42
  86. #define KBC_F10 0x43
  87. #define KBC_NUMLOCK 0x44
  88. #define KBC_SCROLLLOCK 0x45
  89. #define KBC_NUMPAD7 0x46
  90. #define KBC_NUMPAD8 0x47
  91. #define KBC_NUMPAD9 0x48
  92. #define KBC_SUBTRACT 0x49
  93. #define KBC_NUMPAD4 0x4A
  94. #define KBC_NUMPAD5 0x4B
  95. #define KBC_NUMPAD6 0x4C
  96. #define KBC_ADD 0x4D
  97. #define KBC_NUMPAD1 0x4E
  98. #define KBC_NUMPAD2 0x4F
  99. #define KBC_NUMPAD3 0x50
  100. #define KBC_NUMPAD0 0x51
  101. #define KBC_DECIMAL 0x52
  102. #define KBC_F11 0x53
  103. #define KBC_F12 0x54
  104. #define KBC_NUMPADENTER 0x55
  105. #define KBC_RCONTROL 0x56
  106. #define KBC_DIVIDE 0x57
  107. #define KBC_SYSRQ 0x58
  108. #define KBC_RALT 0x59
  109. #define KBC_PAUSE 0x5A
  110. #define KBC_HOME 0x5B
  111. #define KBC_UP 0x5C
  112. #define KBC_PAGEDOWN 0x5D
  113. #define KBC_LEFT 0x5E
  114. #define KBC_RIGHT 0x5F
  115. #define KBC_END 0x60
  116. #define KBC_DOWN 0x61
  117. #define KBC_PAGEUP 0x62
  118. #define KBC_INSERT 0x63
  119. #define KBC_DELETE 0x64
  120. #define MOUSE_LEFTBUTTON 0x65
  121. #define MOUSE_MIDDLEBUTTON 0x66
  122. #define MOUSE_RIGHTBUTTON 0x67
  123. #define MOUSE_WHEEL 0x68
  124. #define MOUSE_MOVE 0x69
  125. #define KBC_CONTROL 0xFFFFFFFE
  126. #define KBC_ALT 0xFFFFFFFD
  127. #define KBC_SHIFT 0xFFFFFFFC
  128. #define STATE_LBUTTONDOWN (1 << 0)
  129. #define STATE_RBUTTONDOWN (1 << 1)
  130. #define STATE_MBUTTONDOWN (1 << 2)
  131. #define STATE_X4BUTTONDOWN (1 << 3)
  132. #define STATE_X5BUTTONDOWN (1 << 4)
  133. /* wrapped opaque data types */
  134. struct input_subsystem;
  135. typedef struct input_subsystem input_t;
  136. EXPORT int input_getbuttonstate(input_t *input, uint32_t button);
  137. #ifdef __cplusplus
  138. }
  139. #endif