diff --git a/src/g_input.c b/src/g_input.c index 44d9f2b2..579a048e 100644 --- a/src/g_input.c +++ b/src/g_input.c @@ -1010,6 +1010,16 @@ void G_ClearControlKeys(INT32 (*setupcontrols)[2], INT32 control) setupcontrols[control][1] = KEY_NULL; } +void G_ClearAllControlKeys(void) +{ + INT32 i; + for (i = 0; i < num_gamecontrols; i++) + { + G_ClearControlKeys(gamecontrol, i); + G_ClearControlKeys(gamecontrolbis, i); + } +} + // // Returns the name of a key (or virtual key for mouse and joy) // the input value being an keynum diff --git a/src/g_input.h b/src/g_input.h index 557fb3bf..102809f7 100644 --- a/src/g_input.h +++ b/src/g_input.h @@ -160,6 +160,7 @@ INT32 G_KeyStringtoNum(const char *keystr); // detach any keys associated to the given game control void G_ClearControlKeys(INT32 (*setupcontrols)[2], INT32 control); +void G_ClearAllControlKeys(void); void Command_Setcontrol_f(void); void Command_Setcontrol2_f(void); void G_Controldefault(void); diff --git a/src/m_misc.c b/src/m_misc.c index 01b468bd..198bc748 100644 --- a/src/m_misc.c +++ b/src/m_misc.c @@ -443,6 +443,7 @@ void Command_LoadConfig_f(void) FIL_ForceExtension(configfile, ".cfg"); // load default control + G_ClearAllControlKeys(); G_Controldefault(); // temporarily reset execversion to default