From 7c76512039bf90c24e38dc3e85f7a2db57b9ba2f Mon Sep 17 00:00:00 2001 From: Brandon Date: Mon, 2 Nov 2020 16:56:28 -0500 Subject: [PATCH] swap A and B for switch --- source/Controls.hx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/source/Controls.hx b/source/Controls.hx index 09e78be79..b251ac61d 100644 --- a/source/Controls.hx +++ b/source/Controls.hx @@ -607,6 +607,7 @@ class Controls extends FlxActionSet public function addDefaultGamepad(id):Void { + #if !switch addGamepadLiteral(id, [ Control.ACCEPT => [A], Control.BACK => [B], @@ -617,6 +618,19 @@ class Controls extends FlxActionSet Control.PAUSE => [START], Control.RESET => [Y] ]); + #else + addGamepadLiteral(id, [ + //Swap A and B for switch + Control.ACCEPT => [B], + Control.BACK => [A], + Control.UP => [DPAD_UP, LEFT_STICK_DIGITAL_UP], + Control.DOWN => [DPAD_DOWN, LEFT_STICK_DIGITAL_DOWN], + Control.LEFT => [DPAD_LEFT, LEFT_STICK_DIGITAL_LEFT], + Control.RIGHT => [DPAD_RIGHT, LEFT_STICK_DIGITAL_RIGHT], + Control.PAUSE => [START], + Control.RESET => [Y] + ]); + #end } /**