Skip to content

Detect Linux touchscreens for multitouch auto mode - #5830

Open
dixonSolutions wants to merge 2 commits into
supertuxkart:masterfrom
dixonSolutions:dixon/linux-touch-autodetect
Open

Detect Linux touchscreens for multitouch auto mode#5830
dixonSolutions wants to merge 2 commits into
supertuxkart:masterfrom
dixonSolutions:dixon/linux-touch-autodetect

Conversation

@dixonSolutions

Copy link
Copy Markdown

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_active 1 already meant "if available", but SDL_GetNumTouchDevices() is often 0 on Linux until the first finger.
  • Scan /proc/bus/input/devices (and DMI chassis / Ubuntu Touch) so Auto works on Linux tablets.
  • Add multitouch_touch_only (default false, so current "any touchscreen" behaviour is unchanged) and Off / Auto / Always in the touch settings dialog.
  • One helper, 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

  • Android/iOS: Auto still enables the race GUI (touch-only is true on those platforms).
  • Linux desktop, no touchscreen: Auto stays off.
  • Linux tablet / Ubuntu Touch: Auto enables with multitouch_touch_only on.
  • Laptop with a keyboard + touchscreen: Auto + touch-only off still matches old "if available"; touch-only on leaves mouse/keyboard.
  • Touch settings: Off / Auto / Always and the touch-only checkbox persist after Apply.

Made with Cursor

dixonSolutions 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant