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;
}
if (down && (key == QFK_ESCAPE || unicode == '\x1b')) {
switch (key_dest) {
case key_menu:
Menu_Leave ();
return;
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");
if (down) {
if (key == key_togglemenu) {
switch (key_dest) {
case key_menu:
Menu_Leave ();
return;
}
case key_game:
Menu_Enter ();
return;
default:
Sys_Error ("Bad key_dest");
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;
}
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
if (unicode == '\x1b' || key == QFK_ESCAPE) {
if (key == key_togglemenu || key == key_toggleconsole) {
Key_Console (key, unicode);
return;
}