4 Copyright (C) 1996-1997 Id Software, Inc.
6 This program is free software; you can redistribute it and/or
7 modify it under the terms of the GNU General Public License
8 as published by the Free Software Foundation; either version 2
9 of the License, or (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15 See the GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to:
20 Free Software Foundation, Inc.
21 59 Temple Place - Suite 330
22 Boston, MA 02111-1307, USA
33 // these are the key numbers that should be passed to Key_Event
41 // normal keys should be passed as lowercased ascii
82 K_KP_DOWNARROW = K_KP_2,
86 K_KP_LEFTARROW = K_KP_4,
89 K_KP_RIGHTARROW = K_KP_6,
93 K_KP_UPARROW = K_KP_8,
97 K_KP_DEL = K_KP_PERIOD,
99 K_KP_SLASH = K_KP_DIVIDE,
106 // mouse buttons generate virtual keys
112 K_MWHEELUP = K_MOUSE4,
114 K_MWHEELDOWN = K_MOUSE5,
148 // aux keys are for multi-buttoned joysticks to generate so they can use
149 // the normal binding process
186 typedef enum { key_game, key_message, key_menu } keydest_t;
188 #define MAX_INPUTLINES 32
189 #define MAX_INPUTLINE 256
190 #define MAX_BINDMAPS 8
191 #define MAX_KEYS 1024
192 extern int edit_line;
193 extern int history_line;
194 extern char key_lines[MAX_INPUTLINES][MAX_INPUTLINE];
195 extern int key_linepos;
196 extern qboolean key_insert; // insert key toggle (for editing)
197 extern keydest_t key_dest;
198 // key_consoleactive bits
199 // user wants console (halfscreen)
200 #define KEY_CONSOLEACTIVE_USER 1
201 // console forced because there's nothing else active (fullscreen)
202 #define KEY_CONSOLEACTIVE_FORCED 4
203 extern int key_consoleactive;
204 extern char *keybindings[MAX_BINDMAPS][MAX_KEYS];
206 extern void Key_ClearEditLine(int edit_line);
207 extern qboolean chat_team;
208 extern char chat_buffer[256];
209 extern unsigned int chat_bufferlen;
211 void Key_WriteBindings(qfile_t *f);
213 void Key_Init_Cvars(void);
214 void Key_Event(int key, char ascii, qboolean down);
215 void Key_ClearStates (void);
216 void Key_SetBinding (int keynum, int bindmap, const char *binding);