input.h 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  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 3 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. #ifndef INPUT_H
  15. #define INPUT_H
  16. /* TODO: incomplete/may not be necessary */
  17. #ifdef __cplusplus
  18. extern "C" {
  19. #endif
  20. #define KBC_ESCAPE 0x0
  21. #define KBC_1 0x1
  22. #define KBC_2 0x2
  23. #define KBC_3 0x3
  24. #define KBC_4 0x4
  25. #define KBC_5 0x5
  26. #define KBC_6 0x6
  27. #define KBC_7 0x7
  28. #define KBC_8 0x8
  29. #define KBC_9 0x9
  30. #define KBC_0 0xA
  31. #define KBC_MINUS 0xB
  32. #define KBC_EQUALS 0xC
  33. #define KBC_BACK 0xD
  34. #define KBC_TAB 0xE
  35. #define KBC_Q 0xF
  36. #define KBC_W 0x10
  37. #define KBC_E 0x11
  38. #define KBC_R 0x12
  39. #define KBC_T 0x13
  40. #define KBC_Y 0x14
  41. #define KBC_U 0x15
  42. #define KBC_I 0x16
  43. #define KBC_O 0x17
  44. #define KBC_P 0x18
  45. #define KBC_LBRACKET 0x19
  46. #define KBC_RBRACKET 0x1A
  47. #define KBC_RETURN 0x1B
  48. #define KBC_LCONTROL 0x1C
  49. #define KBC_A 0x1D
  50. #define KBC_S 0x1E
  51. #define KBC_D 0x1F
  52. #define KBC_F 0x20
  53. #define KBC_G 0x21
  54. #define KBC_H 0x22
  55. #define KBC_J 0x23
  56. #define KBC_K 0x24
  57. #define KBC_L 0x25
  58. #define KBC_SEMICOLON 0x26
  59. #define KBC_APOSTROPHE 0x27
  60. #define KBC_TILDE 0x28
  61. #define KBC_LSHIFT 0x29
  62. #define KBC_BACKSLASH 0x2A
  63. #define KBC_Z 0x2B
  64. #define KBC_X 0x2C
  65. #define KBC_C 0x2D
  66. #define KBC_V 0x2E
  67. #define KBC_B 0x2F
  68. #define KBC_N 0x30
  69. #define KBC_M 0x31
  70. #define KBC_COMMA 0x32
  71. #define KBC_PERIOD 0x33
  72. #define KBC_SLASH 0x34
  73. #define KBC_RSHIFT 0x35
  74. #define KBC_MULTIPLY 0x36
  75. #define KBC_LALT 0x37
  76. #define KBC_SPACE 0x38
  77. #define KBC_CAPSLOCK 0x39
  78. #define KBC_F1 0x3A
  79. #define KBC_F2 0x3B
  80. #define KBC_F3 0x3C
  81. #define KBC_F4 0x3D
  82. #define KBC_F5 0x3E
  83. #define KBC_F6 0x3F
  84. #define KBC_F7 0x40
  85. #define KBC_F8 0x41
  86. #define KBC_F9 0x42
  87. #define KBC_F10 0x43
  88. #define KBC_NUMLOCK 0x44
  89. #define KBC_SCROLLLOCK 0x45
  90. #define KBC_NUMPAD7 0x46
  91. #define KBC_NUMPAD8 0x47
  92. #define KBC_NUMPAD9 0x48
  93. #define KBC_SUBTRACT 0x49
  94. #define KBC_NUMPAD4 0x4A
  95. #define KBC_NUMPAD5 0x4B
  96. #define KBC_NUMPAD6 0x4C
  97. #define KBC_ADD 0x4D
  98. #define KBC_NUMPAD1 0x4E
  99. #define KBC_NUMPAD2 0x4F
  100. #define KBC_NUMPAD3 0x50
  101. #define KBC_NUMPAD0 0x51
  102. #define KBC_DECIMAL 0x52
  103. #define KBC_F11 0x53
  104. #define KBC_F12 0x54
  105. #define KBC_NUMPADENTER 0x55
  106. #define KBC_RCONTROL 0x56
  107. #define KBC_DIVIDE 0x57
  108. #define KBC_SYSRQ 0x58
  109. #define KBC_RALT 0x59
  110. #define KBC_PAUSE 0x5A
  111. #define KBC_HOME 0x5B
  112. #define KBC_UP 0x5C
  113. #define KBC_PAGEDOWN 0x5D
  114. #define KBC_LEFT 0x5E
  115. #define KBC_RIGHT 0x5F
  116. #define KBC_END 0x60
  117. #define KBC_DOWN 0x61
  118. #define KBC_PAGEUP 0x62
  119. #define KBC_INSERT 0x63
  120. #define KBC_DELETE 0x64
  121. #define MOUSE_LEFTBUTTON 0x65
  122. #define MOUSE_MIDDLEBUTTON 0x66
  123. #define MOUSE_RIGHTBUTTON 0x67
  124. #define MOUSE_WHEEL 0x68
  125. #define MOUSE_MOVE 0x69
  126. #define KBC_CONTROL 0xFFFFFFFE
  127. #define KBC_ALT 0xFFFFFFFD
  128. #define KBC_SHIFT 0xFFFFFFFC
  129. #define STATE_LBUTTONDOWN (1<<0)
  130. #define STATE_RBUTTONDOWN (1<<1)
  131. #define STATE_MBUTTONDOWN (1<<2)
  132. #define STATE_X4BUTTONDOWN (1<<3)
  133. #define STATE_X5BUTTONDOWN (1<<4)
  134. /* wrapped opaque data types */
  135. struct input_subsystem;
  136. typedef struct input_subsystem* input_t;
  137. EXPORT int input_getbuttonstate(input_t input, uint32_t button);
  138. #ifdef __cplusplus
  139. }
  140. #endif
  141. #endif