Add "blank" command to allow explicit blocking of fallback from empty ALT mapping

This commit is contained in:
Petr Bartos 2022-03-14 22:57:39 +01:00
parent bc88c1a6b6
commit bebce8bfa6
3 changed files with 12 additions and 9 deletions

View file

@ -198,10 +198,10 @@ static void Controls3_MenuEvent( void* ptr, int notification ) {
} else {
trap_Cvar_Set("vr_button_map_RTHUMBBACK_ALT", "weapprev");
}
trap_Cvar_Set("vr_button_map_RTHUMBFORWARDRIGHT_ALT", ""); // unmapped
trap_Cvar_Set("vr_button_map_RTHUMBBACKRIGHT_ALT", ""); // unmapped
trap_Cvar_Set("vr_button_map_RTHUMBBACKLEFT_ALT", ""); // unmapped
trap_Cvar_Set("vr_button_map_RTHUMBFORWARDLEFT_ALT", ""); // unmapped
trap_Cvar_Set("vr_button_map_RTHUMBFORWARDRIGHT_ALT", "blank"); // unmapped
trap_Cvar_Set("vr_button_map_RTHUMBBACKRIGHT_ALT", "blank"); // unmapped
trap_Cvar_Set("vr_button_map_RTHUMBBACKLEFT_ALT", "blank"); // unmapped
trap_Cvar_Set("vr_button_map_RTHUMBFORWARDLEFT_ALT", "blank"); // unmapped
break;
}
}

View file

@ -143,10 +143,10 @@ void VR_InitCvars( void )
} else {
Cvar_Get ("vr_button_map_RTHUMBBACK_ALT", "weapprev", CVAR_ARCHIVE);
}
Cvar_Get ("vr_button_map_RTHUMBFORWARDRIGHT_ALT", "", CVAR_ARCHIVE); // unmapped
Cvar_Get ("vr_button_map_RTHUMBBACKRIGHT_ALT", "", CVAR_ARCHIVE); // unmapped
Cvar_Get ("vr_button_map_RTHUMBBACKLEFT_ALT", "", CVAR_ARCHIVE); // unmapped
Cvar_Get ("vr_button_map_RTHUMBFORWARDLEFT_ALT", "", CVAR_ARCHIVE); // unmapped
Cvar_Get ("vr_button_map_RTHUMBFORWARDRIGHT_ALT", "blank", CVAR_ARCHIVE); // unmapped
Cvar_Get ("vr_button_map_RTHUMBBACKRIGHT_ALT", "blank", CVAR_ARCHIVE); // unmapped
Cvar_Get ("vr_button_map_RTHUMBBACKLEFT_ALT", "blank", CVAR_ARCHIVE); // unmapped
Cvar_Get ("vr_button_map_RTHUMBFORWARDLEFT_ALT", "blank", CVAR_ARCHIVE); // unmapped
}
//Remaining button mapping (buttons not affected by schemas)

View file

@ -249,7 +249,10 @@ static qboolean IN_SendButtonAction(const char* action, qboolean pressed, qboole
if (action)
{
//handle our special actions first
if (strcmp(action, "+alt") == 0)
if (strcmp(action, "blank") == 0) {
// empty function to block alt fallback on unmapped alt buttons
}
else if (strcmp(action, "+alt") == 0)
{
alt_key_mode_active = pressed;
}