Reset input upon exiting bind menu

While rebininding your controls:

- Do not take a screenshot if you press whichever button
  it was bound to before
- Try not to let a held button press buffer back into the
  controls menu
This commit is contained in:
James R 2023-03-23 22:23:34 -07:00 committed by toaster
parent 80421da5b3
commit 9ca196cb89

View file

@ -316,6 +316,10 @@ void M_MapProfileControl(event_t *ev)
INT32 controln = currentMenu->menuitems[itemOn].mvar1; // gc_
UINT8 where = n; // By default, we'll save the bind where we're supposed to map.
INT32 i;
INT32 *DeviceGameKeyDownArray = G_GetDeviceGameKeyDownArray(ev->device);
if (!DeviceGameKeyDownArray)
return;
//SetDeviceOnPress(); // Update player gamepad assignments
@ -413,6 +417,10 @@ void M_MapProfileControl(event_t *ev)
// Set menu delay regardless of what we're doing to avoid stupid stuff.
M_SetMenuDelay(0);
// Reset this input so (keyboard keys at least) are not
// buffered and caught by menucmd.
DeviceGameKeyDownArray[c] = 0;
// Check if this particular key (c) is already bound in any slot.
// If that's the case, simply do nothing.
for (i = 0; i < MAXINPUTMAPPING; i++)