Use the new menu/console bingings.

Now, the console toggle will always work (so long as the console is
toggleable in the first place).
This commit is contained in:
Bill Currie 2011-12-10 13:22:36 +09:00
parent d9d56760e1
commit 49451eea80
2 changed files with 29 additions and 24 deletions

View file

@ -461,30 +461,35 @@ C_KeyEvent (knum_t key, short unicode, qboolean down)
return; return;
} }
if (down && (key == QFK_ESCAPE || unicode == '\x1b')) { if (down) {
switch (key_dest) { if (key == key_togglemenu) {
case key_menu: switch (key_dest) {
Menu_Leave (); case key_menu:
return; Menu_Leave ();
case key_message:
if (chat_team) {
Con_ClearTyping (say_team_line, 1);
} else {
Con_ClearTyping (say_line, 1);
}
key_dest = key_game;
game_target = IMT_0;
return;
case key_console:
if (!con_data.force_commandline) {
Cbuf_AddText (con_data.cbuf, "toggleconsole\n");
return; return;
} case key_message:
case key_game: if (chat_team) {
Menu_Enter (); Con_ClearTyping (say_team_line, 1);
return; } else {
default: Con_ClearTyping (say_line, 1);
Sys_Error ("Bad key_dest"); }
key_dest = key_game;
game_target = IMT_0;
return;
case key_console:
if (!con_data.force_commandline) {
Cbuf_AddText (con_data.cbuf, "toggleconsole\n");
return;
}
case key_game:
Menu_Enter ();
return;
default:
Sys_Error ("Bad key_dest");
}
} else if (key == key_toggleconsole) {
ToggleConsole_f ();
return;
} }
} }

View file

@ -857,7 +857,7 @@ Key_Event (knum_t key, short unicode, qboolean down)
} }
// handle escape specially, so the user can never unbind it // handle escape specially, so the user can never unbind it
if (unicode == '\x1b' || key == QFK_ESCAPE) { if (key == key_togglemenu || key == key_toggleconsole) {
Key_Console (key, unicode); Key_Console (key, unicode);
return; return;
} }