keys.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. /*
  2. Copyright (C) 1996-1997 Id Software, Inc.
  3. This program is free software; you can redistribute it and/or
  4. modify it under the terms of the GNU General Public License
  5. as published by the Free Software Foundation; either version 2
  6. of the License, or (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.
  10. See the 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, write to the Free Software
  13. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  14. */
  15. //
  16. // these are the key numbers that should be passed to Key_Event
  17. //
  18. #define K_TAB 9
  19. #define K_ENTER 13
  20. #define K_ESCAPE 27
  21. #define K_SPACE 32
  22. // normal keys should be passed as lowercased ascii
  23. #define K_BACKSPACE 127
  24. #define K_UPARROW 128
  25. #define K_DOWNARROW 129
  26. #define K_LEFTARROW 130
  27. #define K_RIGHTARROW 131
  28. #define K_ALT 132
  29. #define K_CTRL 133
  30. #define K_SHIFT 134
  31. #define K_F1 135
  32. #define K_F2 136
  33. #define K_F3 137
  34. #define K_F4 138
  35. #define K_F5 139
  36. #define K_F6 140
  37. #define K_F7 141
  38. #define K_F8 142
  39. #define K_F9 143
  40. #define K_F10 144
  41. #define K_F11 145
  42. #define K_F12 146
  43. #define K_INS 147
  44. #define K_DEL 148
  45. #define K_PGDN 149
  46. #define K_PGUP 150
  47. #define K_HOME 151
  48. #define K_END 152
  49. #define K_PAUSE 255
  50. //
  51. // mouse buttons generate virtual keys
  52. //
  53. #define K_MOUSE1 200
  54. #define K_MOUSE2 201
  55. #define K_MOUSE3 202
  56. //
  57. // joystick buttons
  58. //
  59. #define K_JOY1 203
  60. #define K_JOY2 204
  61. #define K_JOY3 205
  62. #define K_JOY4 206
  63. //
  64. // aux keys are for multi-buttoned joysticks to generate so they can use
  65. // the normal binding process
  66. //
  67. #define K_AUX1 207
  68. #define K_AUX2 208
  69. #define K_AUX3 209
  70. #define K_AUX4 210
  71. #define K_AUX5 211
  72. #define K_AUX6 212
  73. #define K_AUX7 213
  74. #define K_AUX8 214
  75. #define K_AUX9 215
  76. #define K_AUX10 216
  77. #define K_AUX11 217
  78. #define K_AUX12 218
  79. #define K_AUX13 219
  80. #define K_AUX14 220
  81. #define K_AUX15 221
  82. #define K_AUX16 222
  83. #define K_AUX17 223
  84. #define K_AUX18 224
  85. #define K_AUX19 225
  86. #define K_AUX20 226
  87. #define K_AUX21 227
  88. #define K_AUX22 228
  89. #define K_AUX23 229
  90. #define K_AUX24 230
  91. #define K_AUX25 231
  92. #define K_AUX26 232
  93. #define K_AUX27 233
  94. #define K_AUX28 234
  95. #define K_AUX29 235
  96. #define K_AUX30 236
  97. #define K_AUX31 237
  98. #define K_AUX32 238
  99. // JACK: Intellimouse(c) Mouse Wheel Support
  100. #define K_MWHEELUP 239
  101. #define K_MWHEELDOWN 240
  102. typedef enum {key_game, key_console, key_message, key_menu} keydest_t;
  103. extern keydest_t key_dest;
  104. extern char *keybindings[256];
  105. extern int key_repeats[256];
  106. extern int key_count; // incremented every key event
  107. extern int key_lastpress;
  108. extern char chat_buffer[];
  109. extern int chat_bufferlen;
  110. extern qboolean chat_team;
  111. void Key_Event (int key, qboolean down);
  112. void Key_Init (void);
  113. void Key_WriteBindings (FILE *f);
  114. void Key_SetBinding (int keynum, char *binding);
  115. void Key_ClearStates (void);