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

Allow toggling touchscreen mode at runtime #14075

Merged
merged 33 commits into from Feb 22, 2024
Merged

Conversation

okias
Copy link
Contributor

@okias okias commented Dec 6, 2023

What

Allow runtime switching between desktop and touchscreen mode.

How

This PR replaces hardcoded #ifdefs with setting (enable_touch).

Resolves:

Problem solved by this:

Ability to distribute one binary for touchscreen enabled and classic (desktops and laptops without touchscreens).

https://floss.social/@okias/111417351641760633

People love to play Minetest on Linux phones. Some of these phones are convergent, so they work as desktop when connected to USB-C.

Also we have Linux tablets and convertible PCs.

How to test

In the settings appear new checkbox for the touchscreen. You can check it or uncheck it and see whats going to happen.

TODO

  • At some point would be lovely to have touchscreen getting auto-detected.

Depends

@grorp grorp changed the title minetest: allow configurable touchscreen Allow toggling touchscreen mode at runtime Dec 6, 2023
@grorp grorp added Feature ✨ PRs that add or enhance a feature @ Client / Controls / Input Concept approved Approved by a core dev: PRs welcomed! labels Dec 6, 2023
@grorp grorp self-requested a review December 7, 2023 14:27
@grorp grorp added the WIP The PR is still being worked on by its author and not ready yet. label Dec 8, 2023
@okias okias force-pushed the linux-touch branch 4 times, most recently from 90f311d to 4f285d2 Compare December 16, 2023 16:39
@okias okias force-pushed the linux-touch branch 2 times, most recently from 2b80c35 to dd4a7eb Compare December 16, 2023 21:24
@okias okias marked this pull request as ready for review December 16, 2023 21:25
@rubenwardy rubenwardy removed the WIP The PR is still being worked on by its author and not ready yet. label Dec 17, 2023
@rubenwardy
Copy link
Member

rubenwardy commented Dec 17, 2023

For clarity, it would be good to change this to enable_touch_controls or touchscreen_controls. TouchScreenGUI should also be renamed to TouchScreenControls, and touchscreen_gui to touchscreen_controls

src/defaultsettings.cpp Outdated Show resolved Hide resolved
src/defaultsettings.cpp Show resolved Hide resolved
src/defaultsettings.cpp Show resolved Hide resolved
src/client/clientlauncher.cpp Outdated Show resolved Hide resolved
src/client/game.cpp Show resolved Hide resolved
@grorp grorp added the Action / change needed Code still needs changes (PR) / more information requested (Issues) label Dec 22, 2023
@okias okias force-pushed the linux-touch branch 6 times, most recently from 7d16092 to 0648bc0 Compare December 28, 2023 11:45
Signed-off-by: David Heidelberg <david@ixit.cz>
Signed-off-by: David Heidelberg <david@ixit.cz>
Signed-off-by: David Heidelberg <david@ixit.cz>
Signed-off-by: David Heidelberg <david@ixit.cz>
Signed-off-by: David Heidelberg <david@ixit.cz>
@Zughy Zughy removed the Action / change needed Code still needs changes (PR) / more information requested (Issues) label Feb 18, 2024
Copy link
Member

@srifqi srifqi left a comment

Choose a reason for hiding this comment

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

Please also remove TOUCHSCREEN_GUI from .luacheckrc file.

src/gui/guiPasswordChange.cpp Outdated Show resolved Hide resolved
@srifqi srifqi added the Action / change needed Code still needs changes (PR) / more information requested (Issues) label Feb 18, 2024
@srifqi srifqi self-assigned this Feb 18, 2024
Signed-off-by: David Heidelberg <david@ixit.cz>
Signed-off-by: David Heidelberg <david@ixit.cz>
@okias
Copy link
Contributor Author

okias commented Feb 18, 2024

Done

@srifqi srifqi added >= Two approvals ✅ ✅ and removed Action / change needed Code still needs changes (PR) / more information requested (Issues) One approval ✅ ◻️ labels Feb 18, 2024
Copy link
Member

@grorp grorp left a comment

Choose a reason for hiding this comment

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

Still looks good

Co-authored-by: rubenwardy <rw@rubenwardy.com>
Copy link
Member

@rubenwardy rubenwardy left a comment

Choose a reason for hiding this comment

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

Code looks good

@rubenwardy rubenwardy merged commit 34286d7 into minetest:master Feb 22, 2024
15 checks passed
@okias okias deleted the linux-touch branch February 22, 2024 17:21
@okias
Copy link
Contributor Author

okias commented Feb 22, 2024

Follow up: #14400

appgurueu pushed a commit to y5nw/minetest that referenced this pull request Mar 4, 2024
Signed-off-by: David Heidelberg <david@ixit.cz>
Co-authored-by: Gregor Parzefall <gregor.parzefall@posteo.de>
grorp added a commit to grorp/minetest that referenced this pull request Mar 17, 2024
grorp added a commit that referenced this pull request Mar 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@ Client / Controls / Input Concept approved Approved by a core dev: PRs welcomed! Feature ✨ PRs that add or enhance a feature >= Two approvals ✅ ✅
Projects
None yet
Development

Successfully merging this pull request may close these issues.

convergent devices, touchscreen support
6 participants