Key_Message (key, ascii);
break;
case key_menu:
+ case key_menu_grabbed:
MR_KeyEvent (key, ascii, down);
break;
case key_game:
return;
}
- // send function keydowns to interpreter no matter what mode is
+ // send function keydowns to interpreter no matter what mode is (unless the menu has specifically grabbed the keyboard, for rebinding keys)
+ if (key_dest != key_menu_grabbed)
if (key >= K_F1 && key <= K_F12 && down)
{
// ignore key repeats on F1-F12 binds
Key_Message (key, ascii);
break;
case key_menu:
+ case key_menu_grabbed:
MR_KeyEvent (key, ascii, down);
break;
case key_game:
}
keynum_t;
-typedef enum keydest_e { key_game, key_message, key_menu } keydest_t;
+typedef enum keydest_e { key_game, key_message, key_menu, key_menu_grabbed } keydest_t;
#define MAX_INPUTLINES 32
#define MAX_BINDMAPS 8
{
m_entersound = true;
- if (key_dest != key_menu || m_state != m_main)
+ if ((key_dest != key_menu && key_dest != key_menu_grabbed) || m_state != m_main)
{
if(Cmd_Argc() == 2 && !strcmp(Cmd_Argv(1), "1"))
return;
int n;
if (m_state == m_quit)
return;
- wasInMenus = (key_dest == key_menu);
+ wasInMenus = (key_dest == key_menu || key_dest == key_menu_grabbed);
key_dest = key_menu;
m_quit_prevstate = m_state;
m_state = m_quit;
void M_Draw (void)
{
- if (key_dest != key_menu)
+ if (key_dest != key_menu && key_dest != key_menu_grabbed)
m_state = m_none;
if (m_state == m_none)
// key_menu
key_dest = key_menu;
break;
+ case 3:
+ // key_menu_grabbed
+ key_dest = key_menu_grabbed;
+ break;
case 1:
// key_message
// key_dest = key_message
{
VM_SAFEPARMCOUNT(0,VM_M_getkeydest);
- // key_game = 0, key_message = 1, key_menu = 2, unknown = 3
+ // key_game = 0, key_message = 1, key_menu = 2, key_menu_grabbed = 3, unknown = -1
switch(key_dest)
{
case key_game:
case key_menu:
PRVM_G_FLOAT(OFS_RETURN) = 2;
break;
+ case key_menu_grabbed:
+ PRVM_G_FLOAT(OFS_RETURN) = 3;
+ break;
case key_message:
// not supported
// PRVM_G_FLOAT(OFS_RETURN) = 1;
// break;
default:
- PRVM_G_FLOAT(OFS_RETURN) = 3;
+ PRVM_G_FLOAT(OFS_RETURN) = -1;
}
}