-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Prioritise mouse over touch position in osu! gameplay #31892
base: master
Are you sure you want to change the base?
Prioritise mouse over touch position in osu! gameplay #31892
Conversation
if (lastMouseMove == null || Clock.CurrentTime - lastMouseMove.Value > mouse_move_debounce_time) | ||
new MousePositionAbsoluteInput { Position = position }.Apply(CurrentState, this); |
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.
Ignoring touch when there is a mouse event within the last 50 ms is fine (I would increase it to 100 ms). But what's even better is to check if a pen is hovering and ignore all touch input if so. SDL provides us with SDL_EVENT_PEN_PROXIMITY_IN
and SDL_EVENT_PEN_PROXIMITY_OUT
, but o!f is not currently handling those events.
Could have a global bool GameHost.IsPenDetected
, similar to GameHost.OnScreenKeyboardOverlapsGameWindow
.
I honestly think the entire flow here needs to be rethought with pen input in mind. I can't wrap my head around this diff either. I'm hoping this input system becomes as simple as This is not the case in #31704 as it just handles mouse events and sets some flags indicating that suddenly mouse position should not be generated anymore. This is not the case in this PR either as apparently this is adding a method in It would be a more tolerable solution to add support for pen enter/leave events and handle them in |
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.
As per above.
Right, so add proper pen support, the whole flow. Including pen-to-mouse, long tap to right click, be really careful with I think I will first write the modified I don't see this being done quickly, so I guess ppy/osu-framework#6523 should go in. |
Ideally those should also be sent as pen events with a flag distinguishing between them and mobile pen events (i.e. indirect vs on-screen pen input). That would allow proper touchscreen support on Windows. |
Prioritises mouse (or pen hover) input over touch input for cursor position in osu! gameplay.
This will allow hovering pen + click with touch gameplay, with and without ppy/osu-framework#6523. Clicking with the pen still doesn't play nice with touch.
I had a problem with trying to implement
isRealMouseMoveEvent()
as it was difficult to filter out fake events generated forIRequireHighFrequencyMousePosition
. I settled on checking whether the new event reports a position different that the state of the nested input manager (i.e. a change in position).One would expect filtering fake events would be as easy as checking
e.Delta == 0
(as high frequency events shouldn't report any), but the o!f caching of events is broken, resulting in incorrect deltas.Testing
Tested on windows with a touchscreen monitor and vTablet (simulating windows ink). Works fine. But for this virtual tablet specifically,
mouse_move_debounce_time
needs to be increased as it has a low report rate.Mixing tablet and touch input causes visual issues because the game is rapidly switching
Static.TouchInputActive
. A jarring example isHoldForMenuButton
(could be fixed by adding easing).