-
Notifications
You must be signed in to change notification settings - Fork 423
Fix input/hotkey bugs #4403
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix input/hotkey bugs #4403
Conversation
It's pretty hard to verify things are correct now because nothing defines "correct". Let me recap a couple things that happen. If a key combination like "Internal" hotkeys are a separate group from normal hotkeys. If any key press activates a normal hotkey then no internal hotkey will be triggered, regardless of priority setting, except for the The "Hotkeys override Input" branch is especially difficult for me to understand. Am I correct that the following code is functionally equivalent to what the code is currently doing? if (ie.EventType is InputEventType.Press)
{
var handled = triggers.Aggregate(false, (current, trigger) => current | CheckHotkey(trigger));
if (!handled)
{
hotkeyCoalescer.Receive(ie);
if (!triggers.Exists(IsInternalHotkey))
{
finalHostController.Receive(ie);
}
}
}
else
{
hotkeyCoalescer.Receive(ie);
finalHostController.Receive(ie);
} |
Yeah, we really should have some tests for this.
This is correct, with the caveat that you cannot press
Interesting. I had not looked that much into the internal hotkeys.
Yeah lots of this code is tough to read. I believe your code is equivalent. |
|
OP is unclear, but yeah this is the same issue as the comments there are discussing. |
I can't reproduce that with the pausing hotkey. However for frame advance you can use frame inch instead as that immediately pauses instead of waiting for the actual frame loop. |
Oh pause isn't an internal hotkey. Huh. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be fine.
Tests and additional fixes.
This is also fixed. Rebased onto my undo_redo branch (has its own pending PR) in order to make use of test code there. |
This comment was marked as outdated.
This comment was marked as outdated.
a730dca
to
a222310
Compare
Rebased onto master. |
…nternal hotkeys"; all hotkeys go to the hotkey controller now even if we don't expect to read that hotkey from the controller. Fix: Hotkey overrides input would cause an input to continue after a button was released if the input is bound to a combination such as Shift+A and an "internal hotkey" is bound to a single button (such as A). Also input bound to Alt would not have the alt ignored by menus. Passes tests HotkeyOverrideDoesNotEatReleaseEvents and InputIsNotSeenAsUnbound
…re bound to a combination such as Shift+A. passes test ControllerPriorityWithModifier
…be triggered if additional modifier keys were also pressed. passes tests ControllerInputAcceptsOutOfOrderModifier and ControllerInputIgnoresExtraModifier
…were already being held when the hotkey was pressed. passes test AutofireHotkeyDoesNotRespondToAlreadyHeldButton
a222310
to
38a69e8
Compare
I realized that I messed up mouse coordinate transforming here. I've added a new commit 29ed1b3 that fixes that. (It's weird that we translate screen coordinates to client coordinates then to -10k to +10k range and back to client coordinates again but I assume there's a reason for that somewhere.) |
Fix: Hotkey overrides input would cause an input to continue after a button was released if the input is bound to a combination such as Shift+A and an "internal hotkey" is bound to a single button (such as A). Also input bound to Alt would not have the alt ignored by menus.
Fix: Input overrides hotkeys did not work if both input and hotkey were bound to a combination such as Shift+A.
Fix: Controller inputs bound to a modifier key combination would not be triggered if additional modifier keys were also pressed.
Fix: autofire/autohold hotkeys would sometimes activate buttons that were already being held when the hotkey was pressed.
Check if completed: