Detect Linux touchscreens for multitouch auto mode - #5830
Open
dixonSolutions wants to merge 2 commits into
Open
Conversation
added 2 commits
August 13, 2026 08:17
multitouch_active 1 already meant "if available", but SDL_GetNumTouchDevices is often zero on Linux until the first finger. Scan sysfs, distinguish touch-only devices from convertibles with a keyboard, and expose Off/Auto/ Always plus that filter in the touch settings dialog. By creating a pull request in stk-code, you hereby agree to dual-license your contribution as GNU GPL v3 or later and Mozilla Public License v2.
Windows/macOS keep the previous hasHardwareKeyboard default so Auto mode does not treat every desktop as a phone.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
By creating a pull request in stk-code, you hereby agree to dual-license your contribution as
GNU General Public License version 3 or any later version and
Mozilla Public License version 2 or any later version.
This includes your previous contribution(s) under the same name of contributor.
Keep the above statement in the pull request comment for agreement.
Summary
multitouch_active1 already meant "if available", butSDL_GetNumTouchDevices()is often 0 on Linux until the first finger./proc/bus/input/devices(and DMI chassis / Ubuntu Touch) so Auto works on Linux tablets.multitouch_touch_only(default false, so current "any touchscreen" behaviour is unchanged) and Off / Auto / Always in the touch settings dialog.IrrDriver::isMultitouchEnabled(), replaces the repeated 3-line check.We ship a tablet build at SuperTuxKart-Touch that turns the touch-only filter on by default. This PR is only the detection layer, not that product overlay.
Test plan
multitouch_touch_onlyon.Made with Cursor