From bc5c9a1ee9c5e3282e591e3598547eb507dfdf60 Mon Sep 17 00:00:00 2001 From: Dave Nicolson Date: Wed, 17 Feb 2021 21:08:31 +0100 Subject: [PATCH] Add ability to invert controller Y-axis --- Quake-iOS/GameControllerSetup.swift | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Quake-iOS/GameControllerSetup.swift b/Quake-iOS/GameControllerSetup.swift index 1728093..d24b3c9 100644 --- a/Quake-iOS/GameControllerSetup.swift +++ b/Quake-iOS/GameControllerSetup.swift @@ -90,9 +90,13 @@ class GameControllerSetup: NSObject } remote!.extendedGamepad!.rightThumbstick.yAxis.valueChangedHandler = { (button: GCControllerAxisInput, value: Float) -> () in - - in_pitchangle = -value - + + if m_pitch.value > 0 { + in_pitchangle = -value + } else { + in_pitchangle = value + } + } remote!.extendedGamepad!.rightTrigger.pressedChangedHandler = { (button: GCControllerButtonInput, value: Float, pressed: Bool) -> () in