Implement "Touch gliding" (keep all dragged/touched buttons pressed until touch release)

I think the feature might need a better name though?

Fixes #14490
This commit is contained in:
Henrik Rydgård committed 2025-02-14 11:00:24 -06:00
1 parent 4f2ceca071
commit 5ef2f06019
4 files changed
+9 -1

No files matched your search

+1
View File
@@ -284,6 +284,7 @@ static const ConfigSetting generalSettings[] = {
ConfigSetting("SwipeSmoothing", &g_Config.fSwipeSmoothing, 0.3f, CfgFlag::PER_GAME),
ConfigSetting("DoubleTapGesture", &g_Config.iDoubleTapGesture, 0, CfgFlag::PER_GAME),
ConfigSetting("GestureControlEnabled", &g_Config.bGestureControlEnabled, false, CfgFlag::PER_GAME),
ConfigSetting("TouchGliding", &g_Config.bTouchGliding, false, CfgFlag::PER_GAME),
// "default" means let emulator decide, "" means disable.
ConfigSetting("ReportingHost", &g_Config.sReportHost, "default", CfgFlag::DEFAULT),
+5
View File
@@ -361,7 +361,9 @@ public:
// Disable diagonals
bool bDisableDpadDiagonals;
bool bGamepadOnlyFocused;
// Control Style
int iTouchButtonStyle;
int iTouchButtonOpacity;
@@ -377,6 +379,9 @@ public:
// Sticky D-pad (can't glide off it)
bool bStickyTouchDPad;
// Touch gliding (see #14490)
bool bTouchGliding;
//space between PSP buttons
//the PSP button's center (triangle, circle, square, cross)
ConfigTouchPos touchActionButtonCenter;
+2
View File
@@ -801,6 +801,8 @@ void GameSettingsScreen::CreateControlsSettings(UI::ViewGroup *controlsSettings)
autoHide->SetFormat(di->T("%d seconds"));
autoHide->SetZeroLabel(co->T("Off"));
controlsSettings->Add(new CheckBox(&g_Config.bTouchGliding, co->T("Touch gliding")));
// Hide stick background, useful when increasing the size
CheckBox *hideStickBackground = controlsSettings->Add(new CheckBox(&g_Config.bHideStickBackground, co->T("Hide touch analog stick background circle")));
hideStickBackground->SetEnabledPtr(&g_Config.bShowTouchControls);
+1 -1
View File
@@ -110,7 +110,7 @@ bool MultiTouchButton::Touch(const TouchInput &input) {
if (!(input.flags & TOUCH_MOUSE) || input.buttons) {
if (bounds_.Contains(input.x, input.y) && !(analogPointerMask & (1 << input.id)))
pointerDownMask_ |= 1 << input.id;
else
else if (!g_Config.bTouchGliding)
pointerDownMask_ &= ~(1 << input.id);
}
}