00001
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef CLIENT_KEY_H
00030 #define CLIENT_KEY_H
00031
00032
00033
00034
00035
00036 typedef enum {
00037 K_FIRST_KEY,
00038
00039 K_BACKSPACE = 8,
00040 K_TAB = 9,
00041 K_ENTER = 13,
00042 K_PAUSE = 19,
00043 K_ESCAPE = 27,
00044 K_SPACE = 32,
00045 K_DEL = 127,
00046
00047 K_MOUSE1 = 200,
00048 K_MOUSE2 = 201,
00049 K_MOUSE3 = 202,
00050 K_MWHEELDOWN = 239,
00051 K_MWHEELUP = 240,
00052 K_MOUSE4 = 241,
00053 K_MOUSE5 = 242,
00054
00055 K_KP_INS = 256,
00056 K_KP_END = 257,
00057 K_KP_DOWNARROW = 258,
00058 K_KP_PGDN = 259,
00059 K_KP_LEFTARROW = 260,
00060 K_KP_5 = 261,
00061 K_KP_RIGHTARROW = 262,
00062 K_KP_HOME = 263,
00063 K_KP_UPARROW = 264,
00064 K_KP_PGUP = 265,
00065 K_KP_DEL = 266,
00066 K_KP_SLASH = 267,
00067 K_KP_MINUS = 269,
00068 K_KP_PLUS = 270,
00069 K_KP_ENTER = 271,
00070 K_KP_NUMLOCK = 272,
00071
00072 K_UPARROW = 273,
00073 K_DOWNARROW = 274,
00074 K_RIGHTARROW = 275,
00075 K_LEFTARROW = 276,
00076
00077 K_HOME = 278,
00078 K_END = 279,
00079 K_PGUP = 280,
00080 K_PGDN = 281,
00081 K_F1 = 282,
00082 K_F2 = 283,
00083 K_F3 = 284,
00084 K_F4 = 285,
00085 K_F5 = 286,
00086 K_F6 = 287,
00087 K_F7 = 288,
00088 K_F8 = 289,
00089 K_F9 = 290,
00090 K_F10 = 291,
00091 K_F11 = 292,
00092 K_F12 = 293,
00093 K_F13 = 294,
00094 K_F14 = 295,
00095 K_F15 = 296,
00096 K_INS = 277,
00097 K_SHIFT = 304,
00098 K_CTRL = 306,
00099 K_ALT = 308,
00100
00101 K_JOY1,
00102 K_JOY2,
00103 K_JOY3,
00104 K_JOY4,
00105 K_JOY5,
00106 K_JOY6,
00107 K_JOY7,
00108 K_JOY8,
00109 K_JOY9,
00110 K_JOY10,
00111 K_JOY11,
00112 K_JOY12,
00113 K_JOY13,
00114 K_JOY14,
00115 K_JOY15,
00116 K_JOY16,
00117 K_JOY17,
00118 K_JOY18,
00119 K_JOY19,
00120 K_JOY20,
00121 K_JOY21,
00122 K_JOY22,
00123 K_JOY23,
00124 K_JOY24,
00125 K_JOY25,
00126 K_JOY26,
00127 K_JOY27,
00128 K_JOY28,
00129 K_JOY29,
00130 K_JOY30,
00131 K_JOY31,
00132 K_JOY32,
00133
00134 K_AUX1,
00135 K_AUX2,
00136 K_AUX3,
00137 K_AUX4,
00138 K_AUX5,
00139 K_AUX6,
00140 K_AUX7,
00141 K_AUX8,
00142 K_AUX9,
00143 K_AUX10,
00144 K_AUX11,
00145 K_AUX12,
00146 K_AUX13,
00147 K_AUX14,
00148 K_AUX15,
00149 K_AUX16,
00150
00151 K_NUMLOCK,
00152 K_SUPER,
00153 K_COMPOSE,
00154 K_MODE,
00155 K_HELP,
00156 K_PRINT,
00157 K_SYSREQ,
00158 K_SCROLLOCK,
00159 K_BREAK,
00160 K_MENU,
00161 K_EURO,
00162 K_UNDO,
00163
00164 K_COMMAND,
00165 K_CAPSLOCK,
00166 K_POWER,
00167 K_APPS,
00168
00169 K_LAST_KEY = 511,
00170 K_KEY_SIZE = 512
00171 } keyNum_t;
00172
00173 typedef enum {
00174 MSG_SAY,
00175 MSG_SAY_TEAM
00176 } msg_mode_t;
00177
00178 typedef enum {
00179 KEYSPACE_UI,
00180 KEYSPACE_GAME,
00181 KEYSPACE_BATTLE,
00182
00183 KEYSPACE_MAX
00184 } keyBindSpace_t;
00185
00186 #define MAXKEYLINES 32
00187
00188 extern int msgMode;
00189 extern char msgBuffer[MAXCMDLINE];
00190 extern size_t msgBufferLen;
00191 extern char keyLines[MAXKEYLINES][MAXCMDLINE];
00192 extern int keyLinePos;
00193 extern int historyLine;
00194 extern int editLine;
00195 extern char *keyBindings[K_KEY_SIZE];
00196 extern char *menuKeyBindings[K_KEY_SIZE];
00197 extern char *battleKeyBindings[K_KEY_SIZE];
00198
00199 void Key_SetDest(int key_dest);
00200 void Key_Event(unsigned int key, unsigned short unicode, qboolean down, unsigned time);
00201 void Key_Init(void);
00202 void Key_WriteBindings(const char* filename);
00203 const char* Key_GetBinding(const char *binding, keyBindSpace_t space);
00204 const char *Key_KeynumToString(int keynum);
00205 void Key_SetBinding(int keynum, const char *binding, keyBindSpace_t space);
00206
00207 #endif