[PR #1723] Add touch gliding #664

Closed
opened 2026-01-29 19:09:00 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/stenzek/duckstation/pull/1723

State: closed
Merged: Yes


This PR adds the functionality I requested in #1065, that is, touch gliding (for lack of a better name) for Android. The commit has been tested extensively for the better part of a day on a real phone.

This basically keeps the first button held as long as your finger keeps touching the screen. This lets you hold square and then glide/slide over to X to charge and jump as Spyro with minimal effort, using your touchscreen. It also supports multiple touch traces, perfect for games like, I don't know, Crash Team Racing (X to Circle for using items without losing speed, R1<>L1 for drifting and boosting, both can happen concurrently).

How does this work:
A map (mFirstHolds) is available for linking touch pointer IDs to button views. When you touch the screen, a pointer is made. Now, when your pointer starts on, or goes to the first button, the map saves the pointerID>buttonview combo. Any future buttons this pointer slides over are not saved in the combo, but will be activated, and when you slide away it will disable, but the first button remains on. You can do this for as many fingers as you can possibly get on the screen, and they'll be treated separately.

The moment one of your pointers let go of the screen, the combo that was mapped is deleted. When all pointers are released, the map is wholly cleared.

**Original Pull Request:** https://github.com/stenzek/duckstation/pull/1723 **State:** closed **Merged:** Yes --- This PR adds the functionality I requested in #1065, that is, touch gliding (for lack of a better name) for Android. The commit has been tested extensively for the better part of a day on a real phone. This basically keeps the first button held as long as your finger keeps touching the screen. This lets you hold square and then glide/slide over to X to charge and jump as Spyro with minimal effort, using your touchscreen. It also supports multiple touch traces, perfect for games like, I don't know, Crash Team Racing (X to Circle for using items without losing speed, R1<>L1 for drifting and boosting, both can happen concurrently). How does this work: A map (mFirstHolds) is available for linking touch pointer IDs to button views. When you touch the screen, a pointer is made. Now, when your pointer starts on, or goes to the first button, the map saves the pointerID>buttonview combo. Any future buttons this pointer slides over are not saved in the combo, but will be activated, and when you slide away it will disable, but the first button remains on. You can do this for as many fingers as you can possibly get on the screen, and they'll be treated separately. The moment one of your pointers let go of the screen, the combo that was mapped is deleted. When all pointers are released, the map is wholly cleared.
claunia added the pull-request label 2026-01-29 19:09:00 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/duckstation#664