Skip to content
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

Make PassThroughInputManager sync with parent input state #1682

Merged
merged 22 commits into from
Jul 11, 2018

Conversation

ekrctb
Copy link
Collaborator

@ekrctb ekrctb commented Jul 3, 2018

When UseParentInput is true, a PassThroughInputManager syncs its keyboard and joystick state to parent InputManager's state.
For mouse buttons, only input that reached event handlers (OnMouseDown and OnMouseUp) are applied. Click initiated at outside of the PassThroughInputManager and blocked inputs are not synced. However, always sync MouseUp to maintain an invariant (for a mouse button) this.pressed <= parent.pressed. This is because a mouse inputs are positional and this behavior is matching to regular Drawables.

  • Closes PassThroughInputManager needs to receive initial state from parent #1672
  • When KeyBindingContainer handles OnKeyDown before KeyBindings are set there was a null reference. I fixed this. However, the new KeyBindingContainer doesn't fire actions that is bind to keys pressed while the new KeyBindingContainer is initialized. For example, when entering osu!catch play while pressing an arrow key, the catcher isn't moving initially. I think this is allowable but maybe should fix if people need.

@peppy peppy changed the title Make PassThroughInputManager syncs to parent input state Make PassThroughInputManager sync with parent input state Jul 10, 2018
@ekrctb
Copy link
Collaborator Author

ekrctb commented Jul 10, 2018

I originally thought it is good to reset input state when UseParentInput becomes false but I now think not resetting is more natural and sometimes useful.
An issue for current implementation is the input state is not reset even if we do UseParentInput = false when it is already false.

@peppy peppy merged commit 6fb1096 into ppy:master Jul 11, 2018
@peppy
Copy link
Member

peppy commented Jul 11, 2018

Good job on this one. It's feeling quite solid. Make sure to claim the bounty on the original issue.

@ekrctb ekrctb deleted the fix-pass-through-input-manager branch July 11, 2018 06:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PassThroughInputManager needs to receive initial state from parent
2 participants