2 Copyright (C) 1996-1997 Id Software, Inc.
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License
6 as published by the Free Software Foundation; either version 2
7 of the License, or (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 See the GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to:
18 Free Software Foundation, Inc.
19 59 Temple Place - Suite 330
20 Boston, MA 02111-1307, USA
27 key up events are sent even if in console mode
30 #define MAX_INPUTLINE 256
32 int history_line = 31;
33 char key_lines[32][MAX_INPUTLINE];
35 int key_insert = true; // insert key toggle (for editing)
38 int key_consoleactive;
40 static int key_bmap, key_bmap2;
42 char *keybindings[8][1024];
43 static qboolean consolekeys[1024]; // if true, can't be rebound while in
45 static qboolean menubound[1024]; // if true, can't be rebound while in
47 static unsigned int key_repeats[1024]; // if > 1, it is autorepeating
48 static qboolean keydown[1024];
55 static const keyname_t keynames[] = {
60 {"BACKSPACE", K_BACKSPACE},
61 {"UPARROW", K_UPARROW},
62 {"DOWNARROW", K_DOWNARROW},
63 {"LEFTARROW", K_LEFTARROW},
64 {"RIGHTARROW", K_RIGHTARROW},
92 {"MWHEELUP", K_MWHEELUP},
93 {"MWHEELDOWN", K_MWHEELDOWN},
100 {"MOUSE6", K_MOUSE6},
101 {"MOUSE7", K_MOUSE7},
102 {"MOUSE8", K_MOUSE8},
103 {"MOUSE9", K_MOUSE9},
104 {"MOUSE10", K_MOUSE10},
105 {"MOUSE11", K_MOUSE11},
106 {"MOUSE12", K_MOUSE12},
107 {"MOUSE13", K_MOUSE13},
108 {"MOUSE14", K_MOUSE14},
109 {"MOUSE15", K_MOUSE15},
110 {"MOUSE16", K_MOUSE16},
112 {"NUMLOCK", K_NUMLOCK},
113 {"CAPSLOCK", K_CAPSLOCK},
114 {"SCROLLOCK", K_SCROLLOCK},
116 {"KP_HOME", K_KP_HOME },
117 {"KP_UPARROW", K_KP_UPARROW },
118 {"KP_PGUP", K_KP_PGUP },
119 {"KP_LEFTARROW", K_KP_LEFTARROW },
120 {"KP_RIGHTARROW", K_KP_RIGHTARROW },
121 {"KP_END", K_KP_END },
122 {"KP_DOWNARROW", K_KP_DOWNARROW },
123 {"KP_PGDN", K_KP_PGDN },
124 {"KP_INS", K_KP_INS },
125 {"KP_DEL", K_KP_DEL },
126 {"KP_SLASH", K_KP_SLASH },
138 {"KP_PERIOD", K_KP_PERIOD},
139 {"KP_DIVIDE", K_KP_DIVIDE},
140 {"KP_MULTIPLY", K_KP_MULTIPLY},
141 {"KP_MINUS", K_KP_MINUS},
142 {"KP_PLUS", K_KP_PLUS},
143 {"KP_ENTER", K_KP_ENTER},
144 {"KP_EQUALS", K_KP_EQUALS},
196 {"SEMICOLON", ';'}, // because a raw semicolon seperates commands
200 {"APOSTROPHE", '\''},
206 ==============================================================================
208 LINE TYPING INTO THE CONSOLE
210 ==============================================================================
214 Key_ClearEditLine (int edit_line)
216 memset (key_lines[edit_line], '\0', MAX_INPUTLINE);
217 key_lines[edit_line][0] = ']';
223 Interactive line editing and console scrollback
227 Key_Console (int key, char ascii)
229 // LordHavoc: copied most of this from Q2 to improve keyboard handling
256 case K_KP_RIGHTARROW:
276 if ((toupper(key) == 'V' && keydown[K_CTRL]) || ((key == K_INS || key == K_KP_INS) && keydown[K_SHIFT]))
279 if ((cbd = Sys_GetClipboardData()) != 0)
282 strtok(cbd, "\n\r\b");
284 if (i + key_linepos >= MAX_INPUTLINE)
285 i= MAX_INPUTLINE - key_linepos;
289 strcat(key_lines[edit_line], cbd);
301 Cbuf_AddText ("clear\n");
306 if (key == K_ENTER || key == K_KP_ENTER)
308 Cbuf_AddText (key_lines[edit_line]+1); // skip the ]
310 Con_Printf("%s\n",key_lines[edit_line]);
311 // LordHavoc: redesigned edit_line/history_line
313 history_line = edit_line;
314 memmove(key_lines[0], key_lines[1], sizeof(key_lines[0]) * edit_line);
315 key_lines[edit_line][0] = ']';
316 key_lines[edit_line][1] = 0; // EvilTypeGuy: null terminate
318 // force an update, because the command may take some time
319 if (cls.state == ca_disconnected)
326 // Enhanced command completion
327 // by EvilTypeGuy eviltypeguy@qeradiant.com
328 // Thanks to Fett, Taniwha
329 Con_CompleteCommandLine();
333 // Advanced Console Editing by Radix radix@planetquake.com
334 // Added/Modified by EvilTypeGuy eviltypeguy@qeradiant.com
336 // left arrow will just move left one without erasing, backspace will
337 // actually erase charcter
338 if (key == K_LEFTARROW || key == K_KP_LEFTARROW)
345 // delete char before cursor
346 if (key == K_BACKSPACE || (key == 'h' && keydown[K_CTRL]))
350 strcpy(key_lines[edit_line] + key_linepos - 1, key_lines[edit_line] + key_linepos);
356 // delete char on cursor
357 if (key == K_DEL || key == K_KP_DEL)
359 if ((size_t)key_linepos < strlen(key_lines[edit_line]))
360 strcpy(key_lines[edit_line] + key_linepos, key_lines[edit_line] + key_linepos + 1);
365 // if we're at the end, get one character from previous line,
366 // otherwise just go right one
367 if (key == K_RIGHTARROW || key == K_KP_RIGHTARROW)
369 if ((size_t)key_linepos < strlen(key_lines[edit_line]))
375 if (key == K_INS || key == K_KP_INS) // toggle insert mode
381 // End Advanced Console Editing
383 if (key == K_UPARROW || key == K_KP_UPARROW || (key == 'p' && keydown[K_CTRL]))
385 if (history_line > 0 && key_lines[history_line-1][1])
388 strcpy(key_lines[edit_line], key_lines[history_line]);
389 key_linepos = strlen(key_lines[edit_line]);
394 if (key == K_DOWNARROW || key == K_KP_DOWNARROW || (key == 'n' && keydown[K_CTRL]))
397 if (history_line >= edit_line)
399 history_line = edit_line;
400 key_lines[edit_line][0] = ']';
401 key_lines[edit_line][1] = 0;
406 strcpy(key_lines[edit_line], key_lines[history_line]);
407 key_linepos = strlen(key_lines[edit_line]);
412 if (key == K_PGUP || key == K_KP_PGUP || key == K_MWHEELUP)
414 con_backscroll += ((int) vid_conheight.integer >> 5);
415 if (con_backscroll > con_totallines - (vid_conheight.integer>>3) - 1)
416 con_backscroll = con_totallines - (vid_conheight.integer>>3) - 1;
420 if (key == K_PGDN || key == K_KP_PGDN || key == K_MWHEELDOWN)
422 con_backscroll -= ((int) vid_conheight.integer >> 5);
423 if (con_backscroll < 0)
428 if (key == K_HOME || key == K_KP_HOME)
430 con_backscroll = con_totallines - (vid_conheight.integer>>3) - 1;
434 if (key == K_END || key == K_KP_END)
444 if (key_linepos < MAX_INPUTLINE-1)
447 len = strlen(&key_lines[edit_line][key_linepos]);
448 // check insert mode, or always insert if at end of line
449 if (key_insert || len == 0)
451 // can't use strcpy to move string to right
453 memmove(&key_lines[edit_line][key_linepos + 1], &key_lines[edit_line][key_linepos], len);
455 key_lines[edit_line][key_linepos] = ascii;
460 //============================================================================
463 char chat_buffer[MAX_INPUTLINE];
464 unsigned int chat_bufferlen = 0;
467 Key_Message (int key, char ascii)
472 Cmd_ForwardStringToServer(va("%s %s", chat_team ? "say_team" : "say ", chat_buffer));
480 if (key == K_ESCAPE) {
487 if (key == K_BACKSPACE) {
488 if (chat_bufferlen) {
490 chat_buffer[chat_bufferlen] = 0;
495 if (chat_bufferlen == sizeof (chat_buffer) - 1)
499 return; // non printable
501 chat_buffer[chat_bufferlen++] = ascii;
502 chat_buffer[chat_bufferlen] = 0;
505 //============================================================================
510 Returns a key number to be used to index keybindings[] by looking at
511 the given string. Single ascii characters return themselves, while
512 the K_* names are matched up.
516 Key_StringToKeynum (const char *str)
523 return tolower(str[0]);
525 for (kn = keynames; kn->name; kn++) {
526 if (!strcasecmp (str, kn->name))
534 Returns a string (either a single ascii char, or a K_* name) for the
536 FIXME: handle quote special (general escape sequence?)
540 Key_KeynumToString (int keynum)
543 static char tinystr[2];
546 return "<KEY NOT FOUND>";
547 if (keynum > 32 && keynum < 127) { // printable ascii
553 for (kn = keynames; kn->name; kn++)
554 if (keynum == kn->keynum)
557 return "<UNKNOWN KEYNUM>";
562 Key_SetBinding (int keynum, int bindmap, const char *binding)
571 if (keybindings[bindmap][keynum]) {
572 Z_Free (keybindings[bindmap][keynum]);
573 keybindings[bindmap][keynum] = NULL;
575 // allocate memory for new binding
576 l = strlen (binding);
577 new = Z_Malloc (l + 1);
578 strcpy (new, binding);
580 keybindings[bindmap][keynum] = new;
584 Key_In_Unbind_f (void)
588 if (Cmd_Argc () != 3) {
589 Con_Print("in_unbind <bindmap> <key> : remove commands from a key\n");
593 m = strtol(Cmd_Argv (1), NULL, 0);
594 if ((m < 0) || (m >= 8)) {
595 Con_Printf("%d isn't a valid bindmap\n", m);
599 b = Key_StringToKeynum (Cmd_Argv (2));
601 Con_Printf("\"%s\" isn't a valid key\n", Cmd_Argv (2));
605 Key_SetBinding (b, m, "");
616 if (c != 3 && c != 4) {
617 Con_Print("in_bind <bindmap> <key> [command] : attach a command to a key\n");
621 m = strtol(Cmd_Argv (1), NULL, 0);
622 if ((m < 0) || (m >= 8)) {
623 Con_Printf("%d isn't a valid bindmap\n", m);
627 b = Key_StringToKeynum (Cmd_Argv (2));
629 Con_Printf("\"%s\" isn't a valid key\n", Cmd_Argv (2));
634 if (keybindings[m][b])
635 Con_Printf("\"%s\" = \"%s\"\n", Cmd_Argv (2), keybindings[m][b]);
637 Con_Printf("\"%s\" is not bound\n", Cmd_Argv (2));
640 // copy the rest of the command line
641 cmd[0] = 0; // start out with a null string
642 for (i = 3; i < c; i++) {
643 strlcat (cmd, Cmd_Argv (i), sizeof (cmd));
645 strlcat (cmd, " ", sizeof (cmd));
648 Key_SetBinding (b, m, cmd);
652 Key_In_Bindmap_f (void)
659 Con_Print("in_bindmap <bindmap> <fallback>: set current bindmap and fallback\n");
663 m1 = strtol(Cmd_Argv (1), NULL, 0);
664 if ((m1 < 0) || (m1 >= 8)) {
665 Con_Printf("%d isn't a valid bindmap\n", m1);
669 m2 = strtol(Cmd_Argv (2), NULL, 0);
670 if ((m2 < 0) || (m2 >= 8)) {
671 Con_Printf("%d isn't a valid bindmap\n", m2);
684 if (Cmd_Argc () != 2) {
685 Con_Print("unbind <key> : remove commands from a key\n");
689 b = Key_StringToKeynum (Cmd_Argv (1));
691 Con_Printf("\"%s\" isn't a valid key\n", Cmd_Argv (1));
695 Key_SetBinding (b, 0, "");
699 Key_Unbindall_f (void)
703 for (j = 0; j < 8; j++)
704 for (i = 0; i < (int)(sizeof(keybindings[0])/sizeof(keybindings[0][0])); i++)
705 if (keybindings[j][i])
706 Key_SetBinding (i, j, "");
718 if (c != 2 && c != 3) {
719 Con_Print("bind <key> [command] : attach a command to a key\n");
722 b = Key_StringToKeynum (Cmd_Argv (1));
724 Con_Printf("\"%s\" isn't a valid key\n", Cmd_Argv (1));
729 if (keybindings[0][b])
730 Con_Printf("\"%s\" = \"%s\"\n", Cmd_Argv (1), keybindings[0][b]);
732 Con_Printf("\"%s\" is not bound\n", Cmd_Argv (1));
735 // copy the rest of the command line
736 cmd[0] = 0; // start out with a null string
737 for (i = 2; i < c; i++) {
738 strlcat (cmd, Cmd_Argv (i), sizeof (cmd));
740 strlcat (cmd, " ", sizeof (cmd));
743 Key_SetBinding (b, 0, cmd);
748 Writes lines containing "bind key value"
752 Key_WriteBindings (qfile_t *f)
756 for (i = 0; i < (int)(sizeof(keybindings[0])/sizeof(keybindings[0][0])); i++)
757 if (keybindings[0][i])
758 FS_Printf(f, "bind \"%s\" \"%s\"\n",
759 Key_KeynumToString (i), keybindings[0][i]);
760 for (j = 1; j < 8; j++)
761 for (i = 0; i < (int)(sizeof(keybindings[0])/sizeof(keybindings[0][0])); i++)
762 if (keybindings[j][i])
763 FS_Printf(f, "in_bind %d \"%s\" \"%s\"\n",
764 j, Key_KeynumToString (i), keybindings[j][i]);
773 for (i = 0; i < 32; i++) {
774 key_lines[i][0] = ']';
780 // init ascii characters in console mode
782 for (i = 32; i < 128; i++)
783 consolekeys[i] = true;
784 consolekeys[K_ENTER] = true; consolekeys[K_KP_ENTER] = true;
785 consolekeys[K_TAB] = true;
786 consolekeys[K_LEFTARROW] = true; consolekeys[K_KP_LEFTARROW] = true;
787 consolekeys[K_RIGHTARROW] = true; consolekeys[K_KP_RIGHTARROW] = true;
788 consolekeys[K_UPARROW] = true; consolekeys[K_KP_UPARROW] = true;
789 consolekeys[K_DOWNARROW] = true; consolekeys[K_KP_DOWNARROW] = true;
790 consolekeys[K_BACKSPACE] = true;
791 consolekeys[K_DEL] = true; consolekeys[K_KP_DEL] = true;
792 consolekeys[K_INS] = true; consolekeys[K_KP_INS] = true;
793 consolekeys[K_HOME] = true; consolekeys[K_KP_HOME] = true;
794 consolekeys[K_END] = true; consolekeys[K_KP_END] = true;
795 consolekeys[K_PGUP] = true; consolekeys[K_KP_PGUP] = true;
796 consolekeys[K_PGDN] = true; consolekeys[K_KP_PGDN] = true;
797 consolekeys[K_SHIFT] = true;
798 consolekeys[K_MWHEELUP] = true;
799 consolekeys[K_MWHEELDOWN] = true;
800 consolekeys[K_KP_PLUS] = true;
801 consolekeys[K_KP_MINUS] = true;
802 consolekeys[K_KP_DIVIDE] = true;
803 consolekeys[K_KP_MULTIPLY] = true;
804 consolekeys['`'] = false;
805 consolekeys['~'] = false;
807 menubound[K_ESCAPE] = true;
808 for (i = 0; i < 12; i++)
809 menubound[K_F1 + i] = true;
812 // register our functions
814 Cmd_AddCommand ("in_bind", Key_In_Bind_f);
815 Cmd_AddCommand ("in_unbind", Key_In_Unbind_f);
816 Cmd_AddCommand ("in_bindmap", Key_In_Bindmap_f);
818 Cmd_AddCommand ("bind", Key_Bind_f);
819 Cmd_AddCommand ("unbind", Key_Unbind_f);
820 Cmd_AddCommand ("unbindall", Key_Unbindall_f);
826 Called by the system between frames for both key up and key down events
827 Should NOT be called during an interrupt!
831 Key_Event (int key, char ascii, qboolean down)
834 #define USERPLAYING() ( !key_consoleactive && key_dest == key_game && (cls.state == ca_connected && cls.signon == SIGNONS) )
838 keydown[ key ] = down;
841 bind = keybindings[ key_bmap ][ key ];
843 bind = keybindings[ key_bmap2 ][ key ];
846 // update key repeats
848 key_repeats[ key ]++;
849 if( key_repeats[ key ] > 1 ) {
850 if( (key_consoleactive && !consolekeys[key]) || USERPLAYING() )
851 return; // ignore most autorepeats
854 key_repeats[ key ] = 0;
858 if( bind && bind[ 0 ] == '+') {
859 Cbuf_AddText( va( "-%s %i\n", bind + 1, key) );
862 // handle ESCAPE specially, so unbinding wont help
863 if( key == K_ESCAPE ) {
864 // shift-escape is a safety measure for users who cant toggle the console otherwise
865 if( keydown[K_SHIFT] ) {
866 Con_ToggleConsole_f();
871 Key_Message( key, ascii );
874 MR_Keydown( key, ascii );
877 if (COM_CheckParm ("-demolooponly"))
885 Sys_Error( "Bad key_dest" );
890 if( !(key_consoleactive && consolekeys[ key ]) && bind && !strncmp( bind, "toggleconsole", strlen( "toggleconsole" ) ) ) {
891 Cbuf_AddText( bind );
892 Cbuf_AddText( "\n" );
893 if( ascii != STRING_COLOR_TAG ) {
897 // during demo playback, all keys ingame bring up the main menu
898 if( cls.demoplayback && !key_consoleactive && key_dest == key_game ) {
899 if (!COM_CheckParm ("-demolooponly"))
904 // menu bind/function keys or normal binds
905 if( (key_dest == key_menu && menubound[key]) || USERPLAYING() ) {
907 if( bind[0] == '+' ) { // button commands add keynum as a parm
908 Cbuf_AddText( va( "%s %i\n", bind, key ) );
910 Cbuf_AddText( bind );
911 Cbuf_AddText( "\n" );
918 // either console or game state key functions
919 if( key_consoleactive ) {
920 Key_Console( key, ascii );
924 Key_Message( key, ascii );
927 MR_Keydown( key, ascii );
933 Sys_Error( "Bad key_dest" );
938 #define USERPLAYING() ( !key_consoleactive && key_dest == key_game && (cls.state == ca_connected && cls.signon == SIGNONS) )
945 bind = keybindings[key_bmap][key];
947 bind = keybindings[key_bmap2][key];
951 // clear repeat count now that the key is released
952 key_repeats[key] = 0;
953 // key up events only generate commands if the game key binding is a button
954 // command (leading + sign). These will occur even in console mode, to
955 // keep the character from continuing an action started before a console
956 // switch. Button commands include the kenum as a parameter, so multiple
957 // downs can be matched with ups
958 if (bind && bind[0] == '+')
959 Cbuf_AddText(va("-%s %i\n", bind + 1, key));
963 // from here on we know this is a down event
965 // increment key repeat count each time a down is received so that things
966 // which want to ignore key repeat can ignore it
969 // key_consoleactive is a flag not a key_dest because the console is a
970 // high priority overlay ontop of the normal screen (designed as a safety
971 // feature so that developers and users can rescue themselves from a bad
974 // this also means that toggling the console on/off does not lose the old
977 // specially handle escape (togglemenu) and shift-escape (toggleconsole)
978 // engine bindings, these are not handled as normal binds so that the user
979 // can recover from a completely empty bindmap
982 // ignore key repeats on escape
983 if (key_repeats[key] > 1)
985 // escape does these things:
986 // key_consolactive - close console
987 // key_message - abort messagemode
988 // key_menu - go to parent menu (or key_game)
989 // key_game - open menu
990 // in all modes shift-escape toggles console
991 if (key_consoleactive || keydown[K_SHIFT])
993 Con_ToggleConsole_f ();
999 Key_Message (key, ascii);
1002 MR_Keydown (key, ascii);
1008 if(UI_Callback_IsSlotUsed(key_dest - 3))
1009 UI_Callback_KeyDown (key, ascii);
1011 Sys_Error ("Bad key_dest");
1016 // send function keydowns to interpreter no matter what mode is
1017 if (key >= K_F1 && key <= K_F12)
1019 // ignore key repeats on F1-F12 binds
1020 if (key_repeats[key] > 1)
1024 // button commands add keynum as a parm
1026 Cbuf_AddText (va("%s %i\n", bind, key));
1029 Cbuf_AddText (bind);
1030 Cbuf_AddText ("\n");
1037 // ignore binds (other than the above escape/F1-F12 keys) while in console
1038 if (key_consoleactive)
1040 // respond to toggleconsole binds while in console unless the pressed key
1041 // happens to be the color prefix character (such as on German keyboards)
1042 if (key_consoleactive && (strncmp(bind, "toggleconsole", strlen("toggleconsole")) || ascii == STRING_COLOR_TAG))
1045 Key_Console (key, ascii);
1049 // anything else is a key press into the game, chat line, or menu
1053 Key_Message (key, ascii);
1056 MR_Keydown (key, ascii);
1059 // ignore key repeats on binds
1060 if (bind && key_repeats[key] == 1)
1062 // button commands add keynum as a parm
1064 Cbuf_AddText (va("%s %i\n", bind, key));
1067 Cbuf_AddText (bind);
1068 Cbuf_AddText ("\n");
1073 if(UI_Callback_IsSlotUsed(key_dest - 3))
1074 UI_Callback_KeyDown (key, ascii);
1076 Sys_Error ("Bad key_dest");
1082 keydown[key] = down;
1085 key_repeats[key] = 0;
1087 key_lastpress = key;
1089 if (key_count <= 0) {
1090 return; // just catching keys for Con_NotifyBox
1093 // update auto-repeat status
1096 if (key_repeats[key] > 1) {
1097 if ((key_consoleactive && !consolekeys[key]) ||
1098 (!key_consoleactive && key_dest == key_game &&
1099 (cls.state == ca_connected && cls.signon == SIGNONS)))
1100 return; // ignore most autorepeats
1108 // handle escape specially, so the user can never unbind it
1110 if (key == K_ESCAPE) {
1113 // ctrl-escape is a safety measure
1116 Con_ToggleConsole_f ();
1121 Key_Message (key, ascii);
1124 MR_Keydown (key, ascii);
1130 if(UI_Callback_IsSlotUsed(key_dest - 3))
1131 UI_Callback_KeyDown (key, ascii);
1133 Sys_Error ("Bad key_dest");
1140 if (!(kb = keybindings[key_bmap][key]))
1141 kb = keybindings[key_bmap2][key];
1142 if (kb && !strncmp(kb, "toggleconsole", strlen("toggleconsole")))
1145 Cbuf_AddText ("\n");
1150 if (key_consoleactive && consolekeys[key] && down)
1151 Key_Console (key, ascii);
1155 // key up events only generate commands if the game key binding is a button
1156 // command (leading + sign). These will occur even in console mode, to
1157 // keep the character from continuing an action started before a console
1158 // switch. Button commands include the kenum as a parameter, so multiple
1159 // downs can be matched with ups
1162 if (!(kb = keybindings[key_bmap][key]))
1163 kb = keybindings[key_bmap2][key];
1165 if (kb && kb[0] == '+') {
1166 dpsnprintf (cmd, sizeof(cmd), "-%s %i\n", kb + 1, key);
1173 // during demo playback, most keys bring up the main menu
1175 if (cls.demoplayback && down && consolekeys[key] && key_dest == key_game) {
1181 // if not a consolekey, send to the interpreter no matter what mode is
1183 if ((key_dest == key_menu && menubound[key])
1184 || (key_consoleactive && !consolekeys[key])
1185 || (key_dest == key_game &&
1186 ((cls.state == ca_connected) || !consolekeys[key]))) {
1187 if (!(kb = keybindings[key_bmap][key]))
1188 kb = keybindings[key_bmap2][key];
1190 if (kb[0] == '+') { // button commands add keynum as a parm
1191 dpsnprintf (cmd, sizeof(cmd), "%s %i\n", kb, key);
1195 Cbuf_AddText ("\n");
1202 return; // other systems only care about key
1207 Key_Message (key, ascii);
1210 MR_Keydown (key, ascii);
1213 Key_Console (key, ascii);
1216 if(UI_Callback_IsSlotUsed(key_dest - 3))
1217 UI_Callback_KeyDown (key, ascii);
1219 Sys_Error ("Bad key_dest");
1231 Key_ClearStates (void)
1235 for (i = 0; i < (int)(sizeof(keydown)/sizeof(keydown[0])); i++)