- // JACK: Intellimouse(c) Mouse Wheel Support
-
- K_MWHEELUP,
- K_MWHEELDOWN
-} keynum_t;
-
-
-typedef enum {key_game, key_message, key_menu} keydest_t;
-
-extern int key_consoleactive;
-extern keydest_t key_dest;
-extern char *keybindings[256];
-extern int key_repeats[256];
-extern int key_count; // incremented every key event
-extern int key_lastpress;
-
-void Key_Event (int key, qboolean down);
-void Key_Init (void);
-void Key_WriteBindings (QFile *f);
-void Key_SetBinding (int keynum, char *binding);
+}
+keynum_t;
+
+typedef enum keydest_e { key_game, key_message, key_menu, key_menu_grabbed, key_console, key_void } keydest_t;
+
+#define MAX_BINDMAPS 8
+#define MAX_KEYS 1024
+extern char key_line[MAX_INPUTLINE];
+extern int key_linepos;
+extern qboolean key_insert; // insert key toggle (for editing)
+extern keydest_t key_dest;
+// key_consoleactive bits
+// user wants console (halfscreen)
+#define KEY_CONSOLEACTIVE_USER 1
+// console forced because there's nothing else active (fullscreen)
+#define KEY_CONSOLEACTIVE_FORCED 4
+extern int key_consoleactive;
+extern char *keybindings[MAX_BINDMAPS][MAX_KEYS];
+
+extern void Key_ClearEditLine(int edit_line);
+extern int chat_mode; // 0 for say, 1 for say_team, -1 for command
+extern char chat_buffer[MAX_INPUTLINE];
+extern unsigned int chat_bufferlen;
+
+void Key_WriteBindings(qfile_t *f);
+void Key_Init(void);
+void Key_Shutdown(void);
+void Key_Init_Cvars(void);
+void Key_Event(int key, int ascii, qboolean down);