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 qbyte keydown[1024]; // 0 = up, 1 = down, 2 = repeating
54 static const keyname_t keynames[] = {
59 {"BACKSPACE", K_BACKSPACE},
60 {"UPARROW", K_UPARROW},
61 {"DOWNARROW", K_DOWNARROW},
62 {"LEFTARROW", K_LEFTARROW},
63 {"RIGHTARROW", K_RIGHTARROW},
91 {"MWHEELUP", K_MWHEELUP},
92 {"MWHEELDOWN", K_MWHEELDOWN},
100 {"MOUSE7", K_MOUSE7},
101 {"MOUSE8", K_MOUSE8},
102 {"MOUSE9", K_MOUSE9},
103 {"MOUSE10", K_MOUSE10},
104 {"MOUSE11", K_MOUSE11},
105 {"MOUSE12", K_MOUSE12},
106 {"MOUSE13", K_MOUSE13},
107 {"MOUSE14", K_MOUSE14},
108 {"MOUSE15", K_MOUSE15},
109 {"MOUSE16", K_MOUSE16},
111 {"NUMLOCK", K_NUMLOCK},
112 {"CAPSLOCK", K_CAPSLOCK},
113 {"SCROLLOCK", K_SCROLLOCK},
115 {"KP_HOME", K_KP_HOME },
116 {"KP_UPARROW", K_KP_UPARROW },
117 {"KP_PGUP", K_KP_PGUP },
118 {"KP_LEFTARROW", K_KP_LEFTARROW },
119 {"KP_RIGHTARROW", K_KP_RIGHTARROW },
120 {"KP_END", K_KP_END },
121 {"KP_DOWNARROW", K_KP_DOWNARROW },
122 {"KP_PGDN", K_KP_PGDN },
123 {"KP_INS", K_KP_INS },
124 {"KP_DEL", K_KP_DEL },
125 {"KP_SLASH", K_KP_SLASH },
137 {"KP_PERIOD", K_KP_PERIOD},
138 {"KP_DIVIDE", K_KP_DIVIDE},
139 {"KP_MULTIPLY", K_KP_MULTIPLY},
140 {"KP_MINUS", K_KP_MINUS},
141 {"KP_PLUS", K_KP_PLUS},
142 {"KP_ENTER", K_KP_ENTER},
143 {"KP_EQUALS", K_KP_EQUALS},
195 {"SEMICOLON", ';'}, // because a raw semicolon seperates commands
199 {"APOSTROPHE", '\''},
205 ==============================================================================
207 LINE TYPING INTO THE CONSOLE
209 ==============================================================================
213 Key_ClearEditLine (int edit_line)
215 memset (key_lines[edit_line], '\0', MAX_INPUTLINE);
216 key_lines[edit_line][0] = ']';
222 Interactive line editing and console scrollback
226 Key_Console (int key, char ascii)
228 // LordHavoc: copied most of this from Q2 to improve keyboard handling
255 case K_KP_RIGHTARROW:
275 if ((toupper(key) == 'V' && keydown[K_CTRL]) || ((key == K_INS || key == K_KP_INS) && keydown[K_SHIFT]))
278 if ((cbd = Sys_GetClipboardData()) != 0)
281 strtok(cbd, "\n\r\b");
283 if (i + key_linepos >= MAX_INPUTLINE)
284 i= MAX_INPUTLINE - key_linepos;
288 strcat(key_lines[edit_line], cbd);
300 Cbuf_AddText ("clear\n");
305 if (key == K_ENTER || key == K_KP_ENTER)
307 Cbuf_AddText (key_lines[edit_line]+1); // skip the ]
309 Con_Printf("%s\n",key_lines[edit_line]);
310 // LordHavoc: redesigned edit_line/history_line
312 history_line = edit_line;
313 memmove(key_lines[0], key_lines[1], sizeof(key_lines[0]) * edit_line);
314 key_lines[edit_line][0] = ']';
315 key_lines[edit_line][1] = 0; // EvilTypeGuy: null terminate
317 // force an update, because the command may take some time
318 if (cls.state == ca_disconnected)
325 // Enhanced command completion
326 // by EvilTypeGuy eviltypeguy@qeradiant.com
327 // Thanks to Fett, Taniwha
328 Con_CompleteCommandLine();
332 // Advanced Console Editing by Radix radix@planetquake.com
333 // Added/Modified by EvilTypeGuy eviltypeguy@qeradiant.com
335 // left arrow will just move left one without erasing, backspace will
336 // actually erase charcter
337 if (key == K_LEFTARROW || key == K_KP_LEFTARROW)
344 // delete char before cursor
345 if (key == K_BACKSPACE || (key == 'h' && keydown[K_CTRL]))
349 strcpy(key_lines[edit_line] + key_linepos - 1, key_lines[edit_line] + key_linepos);
355 // delete char on cursor
356 if (key == K_DEL || key == K_KP_DEL)
358 if ((size_t)key_linepos < strlen(key_lines[edit_line]))
359 strcpy(key_lines[edit_line] + key_linepos, key_lines[edit_line] + key_linepos + 1);
364 // if we're at the end, get one character from previous line,
365 // otherwise just go right one
366 if (key == K_RIGHTARROW || key == K_KP_RIGHTARROW)
368 if ((size_t)key_linepos < strlen(key_lines[edit_line]))
374 if (key == K_INS || key == K_KP_INS) // toggle insert mode
380 // End Advanced Console Editing
382 if (key == K_UPARROW || key == K_KP_UPARROW || (key == 'p' && keydown[K_CTRL]))
384 if (history_line > 0 && key_lines[history_line-1][1])
387 strcpy(key_lines[edit_line], key_lines[history_line]);
388 key_linepos = strlen(key_lines[edit_line]);
393 if (key == K_DOWNARROW || key == K_KP_DOWNARROW || (key == 'n' && keydown[K_CTRL]))
396 if (history_line >= edit_line)
398 history_line = edit_line;
399 key_lines[edit_line][0] = ']';
400 key_lines[edit_line][1] = 0;
405 strcpy(key_lines[edit_line], key_lines[history_line]);
406 key_linepos = strlen(key_lines[edit_line]);
411 if (key == K_PGUP || key == K_KP_PGUP || key == K_MWHEELUP)
413 con_backscroll += ((int) vid_conheight.integer >> 5);
414 if (con_backscroll > con_totallines - (vid_conheight.integer>>3) - 1)
415 con_backscroll = con_totallines - (vid_conheight.integer>>3) - 1;
419 if (key == K_PGDN || key == K_KP_PGDN || key == K_MWHEELDOWN)
421 con_backscroll -= ((int) vid_conheight.integer >> 5);
422 if (con_backscroll < 0)
427 if (key == K_HOME || key == K_KP_HOME)
429 con_backscroll = con_totallines - (vid_conheight.integer>>3) - 1;
433 if (key == K_END || key == K_KP_END)
443 if (key_linepos < MAX_INPUTLINE-1)
446 len = strlen(&key_lines[edit_line][key_linepos]);
447 // check insert mode, or always insert if at end of line
448 if (key_insert || len == 0)
450 // can't use strcpy to move string to right
452 memmove(&key_lines[edit_line][key_linepos + 1], &key_lines[edit_line][key_linepos], len);
454 key_lines[edit_line][key_linepos] = ascii;
459 //============================================================================
462 char chat_buffer[MAX_INPUTLINE];
463 unsigned int chat_bufferlen = 0;
466 Key_Message (int key, char ascii)
471 Cmd_ForwardStringToServer(va("%s %s", chat_team ? "say_team" : "say ", chat_buffer));
479 if (key == K_ESCAPE) {
486 if (key == K_BACKSPACE) {
487 if (chat_bufferlen) {
489 chat_buffer[chat_bufferlen] = 0;
494 if (chat_bufferlen == sizeof (chat_buffer) - 1)
498 return; // non printable
500 chat_buffer[chat_bufferlen++] = ascii;
501 chat_buffer[chat_bufferlen] = 0;
504 //============================================================================
509 Returns a key number to be used to index keybindings[] by looking at
510 the given string. Single ascii characters return themselves, while
511 the K_* names are matched up.
515 Key_StringToKeynum (const char *str)
522 return tolower(str[0]);
524 for (kn = keynames; kn->name; kn++) {
525 if (!strcasecmp (str, kn->name))
533 Returns a string (either a single ascii char, or a K_* name) for the
535 FIXME: handle quote special (general escape sequence?)
539 Key_KeynumToString (int keynum)
542 static char tinystr[2];
545 return "<KEY NOT FOUND>";
546 if (keynum > 32 && keynum < 127) { // printable ascii
552 for (kn = keynames; kn->name; kn++)
553 if (keynum == kn->keynum)
556 return "<UNKNOWN KEYNUM>";
561 Key_SetBinding (int keynum, int bindmap, const char *binding)
570 if (keybindings[bindmap][keynum]) {
571 Z_Free (keybindings[bindmap][keynum]);
572 keybindings[bindmap][keynum] = NULL;
574 // allocate memory for new binding
575 l = strlen (binding);
576 new = Z_Malloc (l + 1);
577 strcpy (new, binding);
579 keybindings[bindmap][keynum] = new;
583 Key_In_Unbind_f (void)
587 if (Cmd_Argc () != 3) {
588 Con_Print("in_unbind <bindmap> <key> : remove commands from a key\n");
592 m = strtol(Cmd_Argv (1), NULL, 0);
593 if ((m < 0) || (m >= 8)) {
594 Con_Printf("%d isn't a valid bindmap\n", m);
598 b = Key_StringToKeynum (Cmd_Argv (2));
600 Con_Printf("\"%s\" isn't a valid key\n", Cmd_Argv (2));
604 Key_SetBinding (b, m, "");
615 if (c != 3 && c != 4) {
616 Con_Print("in_bind <bindmap> <key> [command] : attach a command to a key\n");
620 m = strtol(Cmd_Argv (1), NULL, 0);
621 if ((m < 0) || (m >= 8)) {
622 Con_Printf("%d isn't a valid bindmap\n", m);
626 b = Key_StringToKeynum (Cmd_Argv (2));
628 Con_Printf("\"%s\" isn't a valid key\n", Cmd_Argv (2));
633 if (keybindings[m][b])
634 Con_Printf("\"%s\" = \"%s\"\n", Cmd_Argv (2), keybindings[m][b]);
636 Con_Printf("\"%s\" is not bound\n", Cmd_Argv (2));
639 // copy the rest of the command line
640 cmd[0] = 0; // start out with a null string
641 for (i = 3; i < c; i++) {
642 strlcat (cmd, Cmd_Argv (i), sizeof (cmd));
644 strlcat (cmd, " ", sizeof (cmd));
647 Key_SetBinding (b, m, cmd);
651 Key_In_Bindmap_f (void)
658 Con_Print("in_bindmap <bindmap> <fallback>: set current bindmap and fallback\n");
662 m1 = strtol(Cmd_Argv (1), NULL, 0);
663 if ((m1 < 0) || (m1 >= 8)) {
664 Con_Printf("%d isn't a valid bindmap\n", m1);
668 m2 = strtol(Cmd_Argv (2), NULL, 0);
669 if ((m2 < 0) || (m2 >= 8)) {
670 Con_Printf("%d isn't a valid bindmap\n", m2);
683 if (Cmd_Argc () != 2) {
684 Con_Print("unbind <key> : remove commands from a key\n");
688 b = Key_StringToKeynum (Cmd_Argv (1));
690 Con_Printf("\"%s\" isn't a valid key\n", Cmd_Argv (1));
694 Key_SetBinding (b, 0, "");
698 Key_Unbindall_f (void)
702 for (j = 0; j < 8; j++)
703 for (i = 0; i < (int)(sizeof(keybindings[0])/sizeof(keybindings[0][0])); i++)
704 if (keybindings[j][i])
705 Key_SetBinding (i, j, "");
717 if (c != 2 && c != 3) {
718 Con_Print("bind <key> [command] : attach a command to a key\n");
721 b = Key_StringToKeynum (Cmd_Argv (1));
723 Con_Printf("\"%s\" isn't a valid key\n", Cmd_Argv (1));
728 if (keybindings[0][b])
729 Con_Printf("\"%s\" = \"%s\"\n", Cmd_Argv (1), keybindings[0][b]);
731 Con_Printf("\"%s\" is not bound\n", Cmd_Argv (1));
734 // copy the rest of the command line
735 cmd[0] = 0; // start out with a null string
736 for (i = 2; i < c; i++) {
737 strlcat (cmd, Cmd_Argv (i), sizeof (cmd));
739 strlcat (cmd, " ", sizeof (cmd));
742 Key_SetBinding (b, 0, cmd);
747 Writes lines containing "bind key value"
751 Key_WriteBindings (qfile_t *f)
755 for (i = 0; i < (int)(sizeof(keybindings[0])/sizeof(keybindings[0][0])); i++)
756 if (keybindings[0][i])
757 FS_Printf(f, "bind \"%s\" \"%s\"\n",
758 Key_KeynumToString (i), keybindings[0][i]);
759 for (j = 1; j < 8; j++)
760 for (i = 0; i < (int)(sizeof(keybindings[0])/sizeof(keybindings[0][0])); i++)
761 if (keybindings[j][i])
762 FS_Printf(f, "in_bind %d \"%s\" \"%s\"\n",
763 j, Key_KeynumToString (i), keybindings[j][i]);
772 for (i = 0; i < 32; i++) {
773 key_lines[i][0] = ']';
779 // init ascii characters in console mode
781 for (i = 32; i < 128; i++)
782 consolekeys[i] = true;
783 consolekeys[K_ENTER] = true; consolekeys[K_KP_ENTER] = true;
784 consolekeys[K_TAB] = true;
785 consolekeys[K_LEFTARROW] = true; consolekeys[K_KP_LEFTARROW] = true;
786 consolekeys[K_RIGHTARROW] = true; consolekeys[K_KP_RIGHTARROW] = true;
787 consolekeys[K_UPARROW] = true; consolekeys[K_KP_UPARROW] = true;
788 consolekeys[K_DOWNARROW] = true; consolekeys[K_KP_DOWNARROW] = true;
789 consolekeys[K_BACKSPACE] = true;
790 consolekeys[K_DEL] = true; consolekeys[K_KP_DEL] = true;
791 consolekeys[K_INS] = true; consolekeys[K_KP_INS] = true;
792 consolekeys[K_HOME] = true; consolekeys[K_KP_HOME] = true;
793 consolekeys[K_END] = true; consolekeys[K_KP_END] = true;
794 consolekeys[K_PGUP] = true; consolekeys[K_KP_PGUP] = true;
795 consolekeys[K_PGDN] = true; consolekeys[K_KP_PGDN] = true;
796 consolekeys[K_SHIFT] = true;
797 consolekeys[K_MWHEELUP] = true;
798 consolekeys[K_MWHEELDOWN] = true;
799 consolekeys[K_KP_PLUS] = true;
800 consolekeys[K_KP_MINUS] = true;
801 consolekeys[K_KP_DIVIDE] = true;
802 consolekeys[K_KP_MULTIPLY] = true;
803 consolekeys['`'] = false;
804 consolekeys['~'] = false;
806 menubound[K_ESCAPE] = true;
807 for (i = 0; i < 12; i++)
808 menubound[K_F1 + i] = true;
811 // register our functions
813 Cmd_AddCommand ("in_bind", Key_In_Bind_f);
814 Cmd_AddCommand ("in_unbind", Key_In_Unbind_f);
815 Cmd_AddCommand ("in_bindmap", Key_In_Bindmap_f);
817 Cmd_AddCommand ("bind", Key_Bind_f);
818 Cmd_AddCommand ("unbind", Key_Unbind_f);
819 Cmd_AddCommand ("unbindall", Key_Unbindall_f);
825 Called by the system between frames for both key up and key down events
826 Should NOT be called during an interrupt!
830 Key_Event (int key, char ascii, qboolean down)
833 #define USERPLAYING() ( !key_consoleactive && key_dest == key_game && (cls.state == ca_connected && cls.signon == SIGNONS) )
837 bind = keybindings[ key_bmap ][ key ];
839 bind = keybindings[ key_bmap2 ][ key ];
842 // update key repeats
844 keydown[ key ] = min(keydown[ key ] + 1, 2);
845 if( keydown[ key ] > 1 ) {
846 if( (key_consoleactive && !consolekeys[key]) || USERPLAYING() )
847 return; // ignore most autorepeats
854 if( bind && bind[ 0 ] == '+') {
855 Cbuf_AddText( va( "-%s %i\n", bind + 1, key) );
858 // handle ESCAPE specially, so unbinding wont help
859 if( key == K_ESCAPE ) {
860 // shift-escape is a safety measure for users who cant toggle the console otherwise
861 if( keydown[K_SHIFT] ) {
862 Con_ToggleConsole_f();
867 Key_Message( key, ascii );
870 MR_Keydown( key, ascii );
873 if (COM_CheckParm ("-demolooponly"))
881 Sys_Error( "Bad key_dest" );
886 if( !(key_consoleactive && consolekeys[ key ]) && bind && !strncmp( bind, "toggleconsole", strlen( "toggleconsole" ) ) ) {
887 Cbuf_AddText( bind );
888 Cbuf_AddText( "\n" );
889 if( ascii != STRING_COLOR_TAG ) {
893 // during demo playback, all keys ingame bring up the main menu
894 if( cls.demoplayback && !key_consoleactive && key_dest == key_game ) {
895 if (!COM_CheckParm ("-demolooponly"))
900 // menu bind/function keys or normal binds
901 if( (key_dest == key_menu && menubound[key]) || USERPLAYING() ) {
903 if( bind[0] == '+' ) { // button commands add keynum as a parm
904 Cbuf_AddText( va( "%s %i\n", bind, key ) );
906 Cbuf_AddText( bind );
907 Cbuf_AddText( "\n" );
914 // either console or game state key functions
915 if( key_consoleactive ) {
916 Key_Console( key, ascii );
920 Key_Message( key, ascii );
923 MR_Keydown( key, ascii );
929 Sys_Error( "Bad key_dest" );
934 #define USERPLAYING() ( !key_consoleactive && key_dest == key_game && (cls.state == ca_connected && cls.signon == SIGNONS) )
938 bind = keybindings[key_bmap][key];
940 bind = keybindings[key_bmap2][key];
944 // clear repeat count now that the key is released
946 // key up events only generate commands if the game key binding is a button
947 // command (leading + sign). These will occur even in console mode, to
948 // keep the character from continuing an action started before a console
949 // switch. Button commands include the kenum as a parameter, so multiple
950 // downs can be matched with ups
951 if (bind && bind[0] == '+')
952 Cbuf_AddText(va("-%s %i\n", bind + 1, key));
956 // from here on we know this is a down event
958 // increment key repeat count each time a down is received so that things
959 // which want to ignore key repeat can ignore it
960 keydown[key] = min(keydown[key] + 1, 2);
962 // key_consoleactive is a flag not a key_dest because the console is a
963 // high priority overlay ontop of the normal screen (designed as a safety
964 // feature so that developers and users can rescue themselves from a bad
967 // this also means that toggling the console on/off does not lose the old
970 // specially handle escape (togglemenu) and shift-escape (toggleconsole)
971 // engine bindings, these are not handled as normal binds so that the user
972 // can recover from a completely empty bindmap
975 // ignore key repeats on escape
976 if (keydown[key] > 1)
978 // escape does these things:
979 // key_consoleactive - close console
980 // key_message - abort messagemode
981 // key_menu - go to parent menu (or key_game)
982 // key_game - open menu
983 // in all modes shift-escape toggles console
984 if (key_consoleactive || keydown[K_SHIFT])
986 Con_ToggleConsole_f ();
992 Key_Message (key, ascii);
995 MR_Keydown (key, ascii);
1001 if(UI_Callback_IsSlotUsed(key_dest - 3))
1002 UI_Callback_KeyDown (key, ascii);
1004 Sys_Error ("Bad key_dest");
1009 // send function keydowns to interpreter no matter what mode is
1010 if (key >= K_F1 && key <= K_F12)
1012 // ignore key repeats on F1-F12 binds
1013 if (keydown[key] > 1)
1017 // button commands add keynum as a parm
1019 Cbuf_AddText (va("%s %i\n", bind, key));
1022 Cbuf_AddText (bind);
1023 Cbuf_AddText ("\n");
1030 // ignore binds (other than the above escape/F1-F12 keys) while in console
1031 if (key_consoleactive)
1033 // respond to toggleconsole binds while in console unless the pressed key
1034 // happens to be the color prefix character (such as on German keyboards)
1035 if (key_consoleactive && (strncmp(bind, "toggleconsole", strlen("toggleconsole")) || ascii == STRING_COLOR_TAG))
1038 Key_Console (key, ascii);
1042 // anything else is a key press into the game, chat line, or menu
1046 Key_Message (key, ascii);
1049 MR_Keydown (key, ascii);
1052 // ignore key repeats on binds
1053 if (bind && keydown[key] == 1)
1055 // button commands add keynum as a parm
1057 Cbuf_AddText (va("%s %i\n", bind, key));
1060 Cbuf_AddText (bind);
1061 Cbuf_AddText ("\n");
1066 if(UI_Callback_IsSlotUsed(key_dest - 3))
1067 UI_Callback_KeyDown (key, ascii);
1069 Sys_Error ("Bad key_dest");
1078 key_lastpress = key;
1080 if (key_count <= 0) {
1081 return; // just catching keys for Con_NotifyBox
1084 // update auto-repeat status
1086 keydown[key] = min(keydown[key] + 1, 2);
1087 if (keydown[key] > 1) {
1088 if ((key_consoleactive && !consolekeys[key]) ||
1089 (!key_consoleactive && key_dest == key_game &&
1090 (cls.state == ca_connected && cls.signon == SIGNONS)))
1091 return; // ignore most autorepeats
1099 // handle escape specially, so the user can never unbind it
1101 if (key == K_ESCAPE) {
1104 // ctrl-escape is a safety measure
1107 Con_ToggleConsole_f ();
1112 Key_Message (key, ascii);
1115 MR_Keydown (key, ascii);
1121 if(UI_Callback_IsSlotUsed(key_dest - 3))
1122 UI_Callback_KeyDown (key, ascii);
1124 Sys_Error ("Bad key_dest");
1131 if (!(kb = keybindings[key_bmap][key]))
1132 kb = keybindings[key_bmap2][key];
1133 if (kb && !strncmp(kb, "toggleconsole", strlen("toggleconsole")))
1136 Cbuf_AddText ("\n");
1141 if (key_consoleactive && consolekeys[key] && down)
1142 Key_Console (key, ascii);
1146 // key up events only generate commands if the game key binding is a button
1147 // command (leading + sign). These will occur even in console mode, to
1148 // keep the character from continuing an action started before a console
1149 // switch. Button commands include the kenum as a parameter, so multiple
1150 // downs can be matched with ups
1153 if (!(kb = keybindings[key_bmap][key]))
1154 kb = keybindings[key_bmap2][key];
1156 if (kb && kb[0] == '+') {
1157 dpsnprintf (cmd, sizeof(cmd), "-%s %i\n", kb + 1, key);
1164 // during demo playback, most keys bring up the main menu
1166 if (cls.demoplayback && down && consolekeys[key] && key_dest == key_game) {
1172 // if not a consolekey, send to the interpreter no matter what mode is
1174 if ((key_dest == key_menu && menubound[key])
1175 || (key_consoleactive && !consolekeys[key])
1176 || (key_dest == key_game &&
1177 ((cls.state == ca_connected) || !consolekeys[key]))) {
1178 if (!(kb = keybindings[key_bmap][key]))
1179 kb = keybindings[key_bmap2][key];
1181 if (kb[0] == '+') { // button commands add keynum as a parm
1182 dpsnprintf (cmd, sizeof(cmd), "%s %i\n", kb, key);
1186 Cbuf_AddText ("\n");
1193 return; // other systems only care about key
1198 Key_Message (key, ascii);
1201 MR_Keydown (key, ascii);
1204 Key_Console (key, ascii);
1207 if(UI_Callback_IsSlotUsed(key_dest - 3))
1208 UI_Callback_KeyDown (key, ascii);
1210 Sys_Error ("Bad key_dest");
1222 Key_ClearStates (void)
1224 memset(keydown, 0, sizeof(keydown));