mirror of
https://github.com/stenzek/duckstation.git
synced 2026-02-04 05:04:33 +00:00
[PR #1723] [MERGED] Add touch gliding #659
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/stenzek/duckstation/pull/1723
Author: @PookaMustard
Created: 3/2/2021
Status: ✅ Merged
Merged: 3/6/2021
Merged by: @stenzek
Base:
master← Head:master📝 Commits (6)
6950491Add touch glidingb296f08Add attributes for glidability8b8dc8eAccount for touch glide attributesf08f963Ditching glidabitliy arrays3e256f3Merge pull request #1 from PookaMustard/pooka-touch-gliding45e5668Change var name to be consistent with feature name📊 Changes
2 files changed (+38 additions, -17 deletions)
View changed files
📝
android/app/src/main/java/com/github/stenzek/duckstation/TouchscreenControllerButtonView.java(+4 -0)📝
android/app/src/main/java/com/github/stenzek/duckstation/TouchscreenControllerView.java(+34 -17)📄 Description
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.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.