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

Fix mouse input state inconsistencies and add unit tests #1565

Merged
merged 9 commits into from May 25, 2018

Conversation

2 participants
@peppy
Copy link
Member

peppy commented May 24, 2018

This started as a fix for ppy/osu#2158, but ended up as quite a serious improvement to testing and readability of input handling (with a focus on mouse).

The eventual goal is to remove delta values from MouseState and only provide them in MouseEventArgs, but as this is a breaking change I decided to first fix the majority of issues without this reorganisation to begin with.

  • Removes LastState from MouseHandler and JoystickHandler in favour of private fields storing previous values.
  • Refactors createDistinctStates to use similar logic for each device. Should be quite a bit easier to follow now.
  • Removes IRequireHighFrequencyMousePosition from InputManager as it was deemed unneeded.
  • Adds unit/visual tests for mouse states, including nested inside a PassThroughInputManager or two.
  • Equalises wheel values inside OpenTKMouseHandler, removing the need for type checking in InputManager to ignore differing values.
  • Resolves ppy/osu#2158.
  • Fixes crash when mouse wheel events are triggered form a headless context.

@peppy peppy added this to the May 2018 milestone May 24, 2018

@smoogipoo smoogipoo requested review from Tom94 and smoogipoo May 24, 2018

@peppy peppy force-pushed the peppy:wheel-delta-fixes branch from f2c8180 to d1b69b8 May 24, 2018

@Tom94

Tom94 approved these changes May 25, 2018

@Tom94 Tom94 merged commit a191c10 into ppy:master May 25, 2018

1 check passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details

@peppy peppy deleted the peppy:wheel-delta-fixes branch Jul 5, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.