Repository navigation
feat(input): Bring Steam Deck trackpads to touchscreen handhelds - #676
Open
Faga250885 wants to merge 8 commits into
Open
Faga250885 wants to merge 8 commits into
Faga250885 wants to merge 8 commits into
Conversation
Keep upstream AYANEO haptics and kernel fixes. Renumber the two virtual-pad patches after the existing stack; all six patches apply cleanly to the pinned InputPlumber source. Remove the unused React overlay and point source checks at the native renderer.
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.
Summary
Add opt-in virtual Steam Deck trackpads for touchscreen handhelds. Touch regions feed the Steam Deck controller target through InputPlumber, allowing Steam Input to recognize the left and right pads and use their touch/motion for mouse control, virtual/radial menus and other trackpad mappings.
This makes cursor-heavy games and interfaces more practical on handhelds without physical trackpads: strategy games, adventure games, inventories, launchers and Steam's virtual menus are useful examples. The master switch starts off, so normal touchscreen behavior remains the default.
The latest test image has been installed and tested on my Retroid Pocket 6 and is working very well. This includes the latest revision with full-screen single-pad modes and automatic orientation. Other hardware still needs hands-on validation, especially dual-screen routing and different vibration motors.
Demonstration
Watch the demonstration. Some settings and labels have changed since the video was recorded; the behavior below describes the current implementation.
Layouts
The mode selector has a short description immediately below it. Full-screen single-pad modes are explicitly distinguished from split screen.
In either full-screen mode, dragging across the screen's midpoint continues controlling the same pad without a half-screen boundary or a change of pad identity. A stationary short tap still produces a click.
The screen-wide modes enforce their logical pad selection in the backend as well as the UI. Their zone, visual and per-pad controls are disabled. Returning through the mode selector to a two-pad layout enables both pads again. Master toggles and the controller shortcut preserve the selected mode.
Features and behavior
ARMADA_PANEL_ORIENTATIONconvention. There are no user-facing rotation or mirror controls and no additional per-device touchscreen-orientation variable.BTN_LEFTthrough a virtual mouse usinguinput. If that sink is unavailable, the daemon falls back to a native pad press. This is not pressure sensing, and the normal tap path should not be described as a freely remappable native Deck press.Defaults
Master off; both pads selected; bottom corners; Game Mode-only on; shared size 35%; corner offset 8 px; visible-area restriction on; haptics 60%; auto-hide after one second; 2 px outer border at 30% opacity; 24% roundness; white 1 px dots with 4 px spacing at 30% opacity; center indicator off. The optional shortcut defaults to L3 + R3 held for three seconds.
Service lifecycle
Turning the trackpads off stops their touchscreen worker and releases capture, contacts and haptic ownership. The rendering worker also exits when unused, except for the bounded two-second shortcut acknowledgement.
Implementation and review scope
armada-controlarmada_virtual_trackpads.pyvirtual-trackpadsvirtual-trackpads-shortcutvirtual-trackpads-overlay/armada_overlay_session.pyThe new runtime dependencies are
python3-evdev,python3-cairo,libXfixesandlibnotify; GTK/PyGObject are already part of the image.The feature UI is English-only in this PR. Existing Armada locales remain intact; reviewed translations can be submitted separately.
Physical-size presets, physical-dimension quirks, the separate
ARMADA_TOUCHSCREEN_ORIENTATIONvariable, and manual rotation/mirroring have been removed. Existing savedtouchRotationandtouchMirrorvalues are ignored when loading configuration and omitted on the next save, so an old setting cannot silently retain a rotated layout.Current upstream changes, including the AYANEO haptics polling fix, are preserved. The two virtual-pad InputPlumber patches follow the existing upstream patches. The unused React overlay implementation was removed; GTK is the rendering implementation.
Fork-only test/publishing workflows, registry-mirror changes and the scx-scheds build workaround are not included in this PR. The latest feature change is a separate commit,
9d62156, for focused review.Validation
Physical testing
I installed the latest experimental image on my Retroid Pocket 6, tested the updated implementation and confirmed that it works very well before updating this PR. Previous RP6 testing also covered Steam Input recognition, cursor/click use, Steam virtual menus, overlay visibility, haptics, shortcut notices and menu layout.
This is RP6 validation, not a claim of verified behavior on every supported handheld. Dual-screen hardware and other vibration motors still need testers.
Automated tests and published test image
Build and validation run 37998156772, test-image commit
05ed631, completed successfully:armada_virtual_hapticsRust tests covering strength scaling, fade, mute, ordinary-rumble priority and lease validation/expiry.Frontend validation also passed: 31 tests, locale parity/runtime-label checks, TypeScript checking and the plugin build.
The tested image contains the same feature/runtime code as PR commit
9d62156. The only source differences in test commit05ed631are.github/workflows/build.ymlandpackages/scx-scheds/build.sh, used exclusively to build and publish the experimental image.Reproducing the checks
The graphical suite requires Linux, GTK 4, PyGObject with Cairo support, Pycairo, Xvfb, xauth, libXfixes and a D-Bus session. The general shell suite also runs the geometry/lifecycle/haptic checks through
just test; the graphical suite is a separate command.Input constraints and relationship to #502
The configured shortcut still reaches games and can conflict with their bindings. Exclusive touchscreen capture also needs coordination with other features that grab the same device.
#502 provides per-game touchscreen-to-relative-mouse behavior. This implementation feeds left/right Steam Deck touchpad inputs into Steam Input, enabling trackpad mappings and Steam virtual menus. They address related needs through different input paths.
The aim is to make this a maintainable part of Armada. Feedback on architecture, defaults, shortcut integration and testing on additional devices is welcome.