mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-07-11 01:25:07 +02:00
Fixes to gesture mapping - don't gate double-tap and analog between the gesture enable control for each zone.
This commit is contained in:
@@ -1905,7 +1905,7 @@ void GestureMappingScreen::CreateGestureTab(UI::LinearLayout *vert, int zoneInde
|
||||
vert->Add(new PopupSliderChoiceFloat(&zone.fSwipeSmoothing, 0.0f, 0.95f, 0.3f, co->T("Swipe smoothing"), 0.05f, screenManager(), "x"))->SetEnabledPtr(&zone.bGestureControlEnabled);
|
||||
|
||||
vert->Add(new ItemHeader(co->T("Double tap")));
|
||||
vert->Add(new PopupMultiChoice(&zone.iDoubleTapGesture, mc->T("Double tap button"), gestureButton, 0, ARRAY_SIZE(gestureButton), I18NCat::MAPPABLECONTROLS, screenManager()))->SetEnabledPtr(&zone.bGestureControlEnabled);
|
||||
vert->Add(new PopupMultiChoice(&zone.iDoubleTapGesture, mc->T("Double tap button"), gestureButton, 0, ARRAY_SIZE(gestureButton), I18NCat::MAPPABLECONTROLS, screenManager()));
|
||||
|
||||
vert->Add(new ItemHeader(co->T("Analog Stick")));
|
||||
vert->Add(new CheckBox(&zone.bAnalogGesture, co->T("Enable analog stick gesture")));
|
||||
|
||||
+9
-4
@@ -1098,7 +1098,7 @@ GamepadEmuView::GamepadEmuView(const TouchControlConfig &config, float xres, flo
|
||||
|
||||
// Add the two gesture zones.
|
||||
for (int i = 0; i < 2; i++) {
|
||||
if (g_Config.gestureControls[i].bGestureControlEnabled) {
|
||||
if (g_Config.gestureControls[i].bGestureControlEnabled || g_Config.gestureControls[i].bAnalogGesture) {
|
||||
// We have them both cover the whole surface, then limit in the touch handler.
|
||||
// This is because there's no easy way to do "half the screen" in AnchorLayout.
|
||||
// We can do more complex layout combinations, but meh.
|
||||
@@ -1236,6 +1236,14 @@ void GestureGamepad::Update() {
|
||||
const float th = 1.0f;
|
||||
float dx = deltaX_ * g_display.dpi_scale_x * GetZone().fSwipeSensitivity;
|
||||
float dy = deltaY_ * g_display.dpi_scale_y * GetZone().fSwipeSensitivity;
|
||||
const float smoothing = GetZone().fSwipeSmoothing;
|
||||
deltaX_ *= smoothing;
|
||||
deltaY_ *= smoothing;
|
||||
|
||||
if (!GetZone().bGestureControlEnabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (GetZone().iSwipeRight != 0) {
|
||||
if (dx > th) {
|
||||
controlMapper_->PSPKey(DEVICE_ID_TOUCH, GestureKey::keyList[GetZone().iSwipeRight - 1], KeyInputFlags::DOWN);
|
||||
@@ -1272,7 +1280,4 @@ void GestureGamepad::Update() {
|
||||
swipeDownReleased_ = true;
|
||||
}
|
||||
}
|
||||
const float smoothing = GetZone().fSwipeSmoothing;
|
||||
deltaX_ *= smoothing;
|
||||
deltaY_ *= smoothing;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user