Skip to content

Linux touchscreen auto-detection for vid_touchscreen - #6

Open
dixonSolutions wants to merge 1 commit into
xonotic:masterfrom
dixonSolutions:dixon/touchscreen-autodetect
Open

Linux touchscreen auto-detection for vid_touchscreen#6
dixonSolutions wants to merge 1 commit into
xonotic:masterfrom
dixonSolutions:dixon/touchscreen-autodetect

Conversation

@dixonSolutions

Copy link
Copy Markdown

Summary

  • Add vid_touchscreen_mode (0 = off, 1 = auto, 2 = always) and vid_touchscreen_touchonly.
  • Detect Linux touchscreens via SDL, /proc/bus/input/devices, DMI chassis type, and Ubuntu Touch / Lomiri, then derive vid_touchscreen so desktop players stay on mouse/keyboard.
  • Re-scan on the first SDL_FINGERDOWN because SDL often reports zero devices until a finger lands.

This is the engine half of a Linux tablet port (Xonotic-Touch). The CSQC arena overlay stays out of this PR on purpose. Official development is on GitLab; this GitHub PR is so the patch is reviewable here as well. We will follow up on GitLab / Matrix #dev:xonotic.org.

Test plan

  • Desktop with a keyboard and no touchscreen: vid_touchscreen stays 0 with mode Auto.
  • Tablet / Ubuntu Touch / chassis type 11 or 30: Auto enables vid_touchscreen.
  • Convertible with a keyboard attached: Auto + touch-only stays off; Always still works.
  • vid_touchscreen_rescan reprints detection results.
  • Android/iOS (DP_MOBILETOUCH) still force Always.

Made with Cursor

Keep the existing overlay behind vid_touchscreen, and derive it from
vid_touchscreen_mode (off / auto / always) plus a touch-only filter so
desktop players are unchanged while tablets and phones opt in.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant