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

Don't enable relative mouse mode if in touchscreen mode #14118

Merged
merged 2 commits into from Jan 13, 2024

Conversation

grorp
Copy link
Member

@grorp grorp commented Dec 17, 2023

Resolves issue no. 2 described in minetest/irrlicht#262.

With CIrrDeviceSDL on Linux and Windows, enabling relative mouse mode somehow results in simulated mouse events being generated from touch events, although SDL_HINT_MOUSE_TOUCH_EVENTS and SDL_HINT_TOUCH_MOUSE_EVENTS are set to 0. Since Minetest has its own code to synthesize mouse events from touch events, this results in duplicated input. To avoid that, we don't enable relative mouse mode if we're in touchscreen mode.

To do

This PR is a Ready for Review.

How to test

Compile Minetest with ENABLE_TOUCH=TRUE and USE_SDL2=TRUE. See that you don't start digging just because you are touching the on-screen sneak button.

Verify that there are no crashes on Android because getCursorControl returns null.

@grorp grorp force-pushed the touch-no-relative-mouse-mode branch from 2a31aa9 to 5c40b47 Compare January 13, 2024 13:40
Copy link
Member

@sfan5 sfan5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code lgtm, tested desktop+no touch+X11

@grorp grorp merged commit b12be04 into minetest:master Jan 13, 2024
13 checks passed
@grorp grorp deleted the touch-no-relative-mouse-mode branch January 13, 2024 21:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants