diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/input_common/keyboard.cpp | 3 | ||||
| -rw-r--r-- | src/input_common/main.cpp | 2 | ||||
| -rw-r--r-- | src/input_common/sdl/sdl_impl.cpp | 1 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_input_player.cpp | 50 |
4 files changed, 27 insertions, 29 deletions
diff --git a/src/input_common/keyboard.cpp b/src/input_common/keyboard.cpp index eb6c3112b..afb8e6612 100644 --- a/src/input_common/keyboard.cpp +++ b/src/input_common/keyboard.cpp | |||
| @@ -49,9 +49,8 @@ public: | |||
| 49 | void ChangeKeyStatus(int key_code, bool pressed) { | 49 | void ChangeKeyStatus(int key_code, bool pressed) { |
| 50 | std::lock_guard guard{mutex}; | 50 | std::lock_guard guard{mutex}; |
| 51 | for (const KeyButtonPair& pair : list) { | 51 | for (const KeyButtonPair& pair : list) { |
| 52 | if (pair.key_code == key_code) { | 52 | if (pair.key_code == key_code) |
| 53 | pair.key_button->status.store(pressed); | 53 | pair.key_button->status.store(pressed); |
| 54 | } | ||
| 55 | } | 54 | } |
| 56 | } | 55 | } |
| 57 | 56 | ||
diff --git a/src/input_common/main.cpp b/src/input_common/main.cpp index f13420b38..fd0af1019 100644 --- a/src/input_common/main.cpp +++ b/src/input_common/main.cpp | |||
| @@ -45,6 +45,7 @@ void Init() { | |||
| 45 | #ifdef HAVE_SDL2 | 45 | #ifdef HAVE_SDL2 |
| 46 | sdl = SDL::Init(); | 46 | sdl = SDL::Init(); |
| 47 | #endif | 47 | #endif |
| 48 | |||
| 48 | udp = CemuhookUDP::Init(); | 49 | udp = CemuhookUDP::Init(); |
| 49 | } | 50 | } |
| 50 | 51 | ||
| @@ -111,6 +112,7 @@ std::vector<std::unique_ptr<DevicePoller>> GetPollers(DeviceType type) { | |||
| 111 | #ifdef HAVE_SDL2 | 112 | #ifdef HAVE_SDL2 |
| 112 | pollers = sdl->GetPollers(type); | 113 | pollers = sdl->GetPollers(type); |
| 113 | #endif | 114 | #endif |
| 115 | |||
| 114 | return pollers; | 116 | return pollers; |
| 115 | } | 117 | } |
| 116 | 118 | ||
diff --git a/src/input_common/sdl/sdl_impl.cpp b/src/input_common/sdl/sdl_impl.cpp index 6b264f2a6..675b477fa 100644 --- a/src/input_common/sdl/sdl_impl.cpp +++ b/src/input_common/sdl/sdl_impl.cpp | |||
| @@ -444,7 +444,6 @@ private: | |||
| 444 | class SDLAnalogFactory final : public Input::Factory<Input::AnalogDevice> { | 444 | class SDLAnalogFactory final : public Input::Factory<Input::AnalogDevice> { |
| 445 | public: | 445 | public: |
| 446 | explicit SDLAnalogFactory(SDLState& state_) : state(state_) {} | 446 | explicit SDLAnalogFactory(SDLState& state_) : state(state_) {} |
| 447 | |||
| 448 | /** | 447 | /** |
| 449 | * Creates analog device from joystick axes | 448 | * Creates analog device from joystick axes |
| 450 | * @param params contains parameters for creating the device: | 449 | * @param params contains parameters for creating the device: |
diff --git a/src/yuzu/configuration/configure_input_player.cpp b/src/yuzu/configuration/configure_input_player.cpp index 49b8c8386..00433926d 100644 --- a/src/yuzu/configuration/configure_input_player.cpp +++ b/src/yuzu/configuration/configure_input_player.cpp | |||
| @@ -281,25 +281,24 @@ ConfigureInputPlayer::ConfigureInputPlayer(QWidget* parent, std::size_t player_i | |||
| 281 | 281 | ||
| 282 | button->setContextMenuPolicy(Qt::CustomContextMenu); | 282 | button->setContextMenuPolicy(Qt::CustomContextMenu); |
| 283 | connect(button, &QPushButton::clicked, [=] { | 283 | connect(button, &QPushButton::clicked, [=] { |
| 284 | HandleClick( | 284 | HandleClick(button_map[button_id], |
| 285 | button_map[button_id], | 285 | [=](Common::ParamPackage params) { |
| 286 | [=](Common::ParamPackage params) { | 286 | // Workaround for ZL & ZR for analog triggers like on XBOX controllors. |
| 287 | // Workaround for ZL & ZR for analog triggers like on XBOX controllors. | 287 | // Analog triggers (from controllers like the XBOX controller) would not |
| 288 | // Analog triggers (from controllers like the XBOX controller) would not | 288 | // work due to a different range of their signals (from 0 to 255 on |
| 289 | // work due to a different range of their signals (from 0 to 255 on | 289 | // analog triggers instead of -32768 to 32768 on analog joysticks). The |
| 290 | // analog triggers instead of -32768 to 32768 on analog joysticks). The | 290 | // SDL driver misinterprets analog triggers as analog joysticks. |
| 291 | // SDL driver misinterprets analog triggers as analog joysticks. | 291 | // TODO: reinterpret the signal range for analog triggers to map the |
| 292 | // TODO: reinterpret the signal range for analog triggers to map the | 292 | // values correctly. This is required for the correct emulation of the |
| 293 | // values correctly. This is required for the correct emulation of the | 293 | // analog triggers of the GameCube controller. |
| 294 | // analog triggers of the GameCube controller. | 294 | if (button_id == Settings::NativeButton::ZL || |
| 295 | if (button_id == Settings::NativeButton::ZL || | 295 | button_id == Settings::NativeButton::ZR) { |
| 296 | button_id == Settings::NativeButton::ZR) { | 296 | params.Set("direction", "+"); |
| 297 | params.Set("direction", "+"); | 297 | params.Set("threshold", "0.5"); |
| 298 | params.Set("threshold", "0.5"); | 298 | } |
| 299 | } | 299 | buttons_param[button_id] = std::move(params); |
| 300 | buttons_param[button_id] = std::move(params); | 300 | }, |
| 301 | }, | 301 | InputCommon::Polling::DeviceType::Button); |
| 302 | InputCommon::Polling::DeviceType::Button); | ||
| 303 | }); | 302 | }); |
| 304 | connect(button, &QPushButton::customContextMenuRequested, [=](const QPoint& menu_location) { | 303 | connect(button, &QPushButton::customContextMenuRequested, [=](const QPoint& menu_location) { |
| 305 | QMenu context_menu; | 304 | QMenu context_menu; |
| @@ -325,13 +324,12 @@ ConfigureInputPlayer::ConfigureInputPlayer(QWidget* parent, std::size_t player_i | |||
| 325 | 324 | ||
| 326 | analog_button->setContextMenuPolicy(Qt::CustomContextMenu); | 325 | analog_button->setContextMenuPolicy(Qt::CustomContextMenu); |
| 327 | connect(analog_button, &QPushButton::clicked, [=]() { | 326 | connect(analog_button, &QPushButton::clicked, [=]() { |
| 328 | HandleClick( | 327 | HandleClick(analog_map_buttons[analog_id][sub_button_id], |
| 329 | analog_map_buttons[analog_id][sub_button_id], | 328 | [=](const Common::ParamPackage& params) { |
| 330 | [=](const Common::ParamPackage& params) { | 329 | SetAnalogButton(params, analogs_param[analog_id], |
| 331 | SetAnalogButton(params, analogs_param[analog_id], | 330 | analog_sub_buttons[sub_button_id]); |
| 332 | analog_sub_buttons[sub_button_id]); | 331 | }, |
| 333 | }, | 332 | InputCommon::Polling::DeviceType::Button); |
| 334 | InputCommon::Polling::DeviceType::Button); | ||
| 335 | }); | 333 | }); |
| 336 | connect(analog_button, &QPushButton::customContextMenuRequested, | 334 | connect(analog_button, &QPushButton::customContextMenuRequested, |
| 337 | [=](const QPoint& menu_location) { | 335 | [=](const QPoint& menu_location) { |