From 71a81755d02bc5873f00bb75a61bfcfe92a4ab42 Mon Sep 17 00:00:00 2001 From: Sergio Valor Date: Tue, 23 May 2023 20:07:29 +0200 Subject: [PATCH] =?UTF-8?q?input:=20A=C3=B1adidos=20m=C3=A1s=20inputs=20po?= =?UTF-8?q?r=20defecto?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- units/input.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/units/input.cpp b/units/input.cpp index 1a8f9f2..3db3cd8 100644 --- a/units/input.cpp +++ b/units/input.cpp @@ -243,7 +243,7 @@ bool Input::discoverGameController() // name = name + separator + to_string(i); if (verbose) { - cout << " -" << name << endl; + cout << " - " << name << endl; } controllerNames.push_back(name); } @@ -322,14 +322,21 @@ void Input::setDefaultBindings() bindKey(INPUT_DOWN, SDL_SCANCODE_DOWN); bindKey(INPUT_LEFT, SDL_SCANCODE_LEFT); bindKey(INPUT_RIGHT, SDL_SCANCODE_RIGHT); - bindKey(INPUT_EXIT, SDL_SCANCODE_ESCAPE); + + bindKey(INPUT_BUTTON_1, SDL_SCANCODE_Z); + bindKey(INPUT_BUTTON_2, SDL_SCANCODE_X); + bindKey(INPUT_ACCEPT, SDL_SCANCODE_RETURN); + bindKey(INPUT_CANCEL, SDL_SCANCODE_ESCAPE); + bindKey(INPUT_PAUSE, SDL_SCANCODE_H); + bindKey(INPUT_EXIT, SDL_SCANCODE_ESCAPE); // Mando bindGameControllerButton(INPUT_UP, SDL_CONTROLLER_BUTTON_DPAD_UP); bindGameControllerButton(INPUT_DOWN, SDL_CONTROLLER_BUTTON_DPAD_DOWN); bindGameControllerButton(INPUT_LEFT, SDL_CONTROLLER_BUTTON_DPAD_LEFT); bindGameControllerButton(INPUT_RIGHT, SDL_CONTROLLER_BUTTON_DPAD_RIGHT); + bindGameControllerButton(INPUT_BUTTON_1, SDL_CONTROLLER_BUTTON_A); bindGameControllerButton(INPUT_BUTTON_2, SDL_CONTROLLER_BUTTON_B); bindGameControllerButton(INPUT_BUTTON_3, SDL_CONTROLLER_BUTTON_X); @@ -338,4 +345,9 @@ void Input::setDefaultBindings() bindGameControllerButton(INPUT_BUTTON_6, SDL_CONTROLLER_BUTTON_START); bindGameControllerButton(INPUT_BUTTON_7, SDL_CONTROLLER_BUTTON_LEFTSHOULDER); bindGameControllerButton(INPUT_BUTTON_8, SDL_CONTROLLER_BUTTON_RIGHTSHOULDER); + + bindGameControllerButton(INPUT_ACCEPT, SDL_CONTROLLER_BUTTON_A); + bindGameControllerButton(INPUT_CANCEL, SDL_CONTROLLER_BUTTON_B); + bindGameControllerButton(INPUT_PAUSE, SDL_CONTROLLER_BUTTON_START); + bindGameControllerButton(INPUT_EXIT, SDL_CONTROLLER_BUTTON_BACK); } \ No newline at end of file