diff --git a/src/CameraController.hx b/src/CameraController.hx index c3c57d23..c8b0a645 100644 --- a/src/CameraController.hx +++ b/src/CameraController.hx @@ -64,6 +64,8 @@ class CameraController extends Object { var _ignoreCursor:Bool = false; + var wasLastGamepadInput:Bool = false; + public function new(marble:Marble) { super(); this.marble = marble; @@ -141,6 +143,11 @@ class CameraController extends Object { // CameraPitch += deltaposY * factor; // CameraYaw += deltaposX * factor; + if (!isTouch) + wasLastGamepadInput = false; + else + wasLastGamepadInput = true; + nextCameraPitch = CameraPitch + deltaposY * factor; nextCameraYaw = CameraYaw + deltaposX * factor; @@ -209,6 +216,10 @@ class CameraController extends Object { var gamepadX = applyNonlinearScale(rescaleDeadZone(Gamepad.getAxis(Settings.gamepadSettings.cameraXAxis), Settings.gamepadSettings.axisDeadzone)); var gamepadY = rescaleDeadZone(Gamepad.getAxis(Settings.gamepadSettings.cameraYAxis), Settings.gamepadSettings.axisDeadzone); + if (gamepadX != 0.0 || gamepadY != 0.0) { + wasLastGamepadInput = true; + } + var cameraPitchDelta = (Key.isDown(Settings.controlsSettings.camBackward) ? 1 : 0) - (Key.isDown(Settings.controlsSettings.camForward) ? 1 : 0) + gamepadY; diff --git a/src/gui/GuiMLTextListCtrl.hx b/src/gui/GuiMLTextListCtrl.hx index c018c040..3d95fd82 100644 --- a/src/gui/GuiMLTextListCtrl.hx +++ b/src/gui/GuiMLTextListCtrl.hx @@ -315,7 +315,7 @@ class GuiMLTextListCtrl extends GuiControl { onSelectedFunc(_prevSelected); } - var hittestrect = this.getHitTestRect(false); + var hittestrect = this.getHitTestRect(); if (y < 0) { // Scroll up diff --git a/src/gui/GuiTextListCtrl.hx b/src/gui/GuiTextListCtrl.hx index eca45994..8377ad9c 100644 --- a/src/gui/GuiTextListCtrl.hx +++ b/src/gui/GuiTextListCtrl.hx @@ -303,7 +303,7 @@ class GuiTextListCtrl extends GuiControl { onSelectedFunc(_prevSelected); } - var hittestrect = this.getHitTestRect(false); + var hittestrect = this.getHitTestRect(); if (y < 0) { // Scroll up