Further cleanups to `MainForm.ProcessInput`

fixes 2f5dfcea3
This commit is contained in:
YoshiRulz 2024-08-22 22:40:42 +10:00
parent 2f5dfcea33
commit 325880be18
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
1 changed files with 10 additions and 2 deletions

View File

@ -1178,16 +1178,17 @@ namespace BizHawk.Client.EmuHawk
// zero 09-sep-2012 - all input is eligible for controller input. not sure why the above was done.
// maybe because it doesn't make sense to me to bind hotkeys and controller inputs to the same keystrokes
bool handled = false;
switch (Config.InputHotkeyOverrideOptions)
{
default:
case 0: // Both allowed
{
finalHostController.Receive(ie);
var handled = false;
if (ie.EventType is InputEventType.Press)
{
handled = triggers.Aggregate(false, (current, trigger) => current | CheckHotkey(trigger));
handled = triggers.Aggregate(handled, (current, trigger) => current | CheckHotkey(trigger));
}
// hotkeys which aren't handled as actions get coalesced as pollable virtual client buttons
@ -1197,11 +1198,14 @@ namespace BizHawk.Client.EmuHawk
}
break;
}
case 1: // Input overrides Hotkeys
{
finalHostController.Receive(ie);
// don't check hotkeys when any of the pressed keys are input
if (!ie.LogicalButton.ToString().Split('+').Any(activeControllerHasBinding))
{
var handled = false;
if (ie.EventType is InputEventType.Press)
{
handled = triggers.Aggregate(false, (current, trigger) => current | CheckHotkey(trigger));
@ -1215,7 +1219,10 @@ namespace BizHawk.Client.EmuHawk
}
break;
}
case 2: // Hotkeys override Input
{
var handled = false;
if (ie.EventType is InputEventType.Press)
{
handled = triggers.Aggregate(false, (current, trigger) => current | CheckHotkey(trigger));
@ -1231,6 +1238,7 @@ namespace BizHawk.Client.EmuHawk
}
break;
}
}
} // foreach event