diff options
| -rw-r--r-- | src/core/hid/hid_types.h | 3 | ||||
| -rw-r--r-- | src/core/hle/service/hid/controllers/npad.cpp | 2 | ||||
| -rw-r--r-- | src/core/hle/service/hid/ring_lifo.h | 7 | ||||
| -rw-r--r-- | src/input_common/drivers/gc_adapter.cpp | 16 | ||||
| -rw-r--r-- | src/input_common/drivers/gc_adapter.h | 2 | ||||
| -rw-r--r-- | src/input_common/drivers/mouse.cpp | 2 | ||||
| -rw-r--r-- | src/input_common/drivers/mouse.h | 2 | ||||
| -rw-r--r-- | src/input_common/drivers/sdl_driver.cpp | 2 | ||||
| -rw-r--r-- | src/input_common/drivers/sdl_driver.h | 2 | ||||
| -rw-r--r-- | src/input_common/drivers/tas_input.cpp | 2 | ||||
| -rw-r--r-- | src/input_common/drivers/tas_input.h | 2 | ||||
| -rw-r--r-- | src/input_common/drivers/touch_screen.cpp | 2 | ||||
| -rw-r--r-- | src/input_common/drivers/touch_screen.h | 2 | ||||
| -rw-r--r-- | src/input_common/input_engine.cpp | 4 | ||||
| -rw-r--r-- | src/input_common/input_engine.h | 2 | ||||
| -rw-r--r-- | src/yuzu/bootmanager.cpp | 66 | ||||
| -rw-r--r-- | src/yuzu/bootmanager.h | 2 |
17 files changed, 54 insertions, 66 deletions
diff --git a/src/core/hid/hid_types.h b/src/core/hid/hid_types.h index 8b12f63ad..3cbe16260 100644 --- a/src/core/hid/hid_types.h +++ b/src/core/hid/hid_types.h | |||
| @@ -564,8 +564,9 @@ struct MouseState { | |||
| 564 | s32 y; | 564 | s32 y; |
| 565 | s32 delta_x; | 565 | s32 delta_x; |
| 566 | s32 delta_y; | 566 | s32 delta_y; |
| 567 | s32 delta_wheel_x; | 567 | // Axis Order in HW is switched for the wheel |
| 568 | s32 delta_wheel_y; | 568 | s32 delta_wheel_y; |
| 569 | s32 delta_wheel_x; | ||
| 569 | MouseButton button; | 570 | MouseButton button; |
| 570 | MouseAttribute attribute; | 571 | MouseAttribute attribute; |
| 571 | }; | 572 | }; |
diff --git a/src/core/hle/service/hid/controllers/npad.cpp b/src/core/hle/service/hid/controllers/npad.cpp index eaec79139..4b23230e1 100644 --- a/src/core/hle/service/hid/controllers/npad.cpp +++ b/src/core/hle/service/hid/controllers/npad.cpp | |||
| @@ -345,7 +345,7 @@ void Controller_NPad::RequestPadStateUpdate(Core::HID::NpadIdType npad_id) { | |||
| 345 | constexpr btn right_button_mask = btn::A | btn::B | btn::X | btn::Y | btn::StickR | btn::R | | 345 | constexpr btn right_button_mask = btn::A | btn::B | btn::X | btn::Y | btn::StickR | btn::R | |
| 346 | btn::ZR | btn::Plus | btn::StickRLeft | btn::StickRUp | | 346 | btn::ZR | btn::Plus | btn::StickRLeft | btn::StickRUp | |
| 347 | btn::StickRRight | btn::StickRDown; | 347 | btn::StickRRight | btn::StickRDown; |
| 348 | pad_entry.npad_buttons.raw |= button_state.raw & right_button_mask; | 348 | pad_entry.npad_buttons.raw = button_state.raw & right_button_mask; |
| 349 | pad_entry.r_stick = stick_state.right; | 349 | pad_entry.r_stick = stick_state.right; |
| 350 | } | 350 | } |
| 351 | 351 | ||
diff --git a/src/core/hle/service/hid/ring_lifo.h b/src/core/hle/service/hid/ring_lifo.h index 6209ed0d1..f0e0bab7f 100644 --- a/src/core/hle/service/hid/ring_lifo.h +++ b/src/core/hle/service/hid/ring_lifo.h | |||
| @@ -7,7 +7,6 @@ | |||
| 7 | #include <array> | 7 | #include <array> |
| 8 | 8 | ||
| 9 | #include "common/common_types.h" | 9 | #include "common/common_types.h" |
| 10 | #include "common/swap.h" | ||
| 11 | 10 | ||
| 12 | namespace Service::HID { | 11 | namespace Service::HID { |
| 13 | constexpr std::size_t max_buffer_size = 17; | 12 | constexpr std::size_t max_buffer_size = 17; |
| @@ -21,7 +20,7 @@ struct AtomicStorage { | |||
| 21 | template <typename State> | 20 | template <typename State> |
| 22 | struct Lifo { | 21 | struct Lifo { |
| 23 | s64 timestamp{}; | 22 | s64 timestamp{}; |
| 24 | s64 total_buffer_count = max_buffer_size; | 23 | s64 total_buffer_count = static_cast<s64>(max_buffer_size); |
| 25 | s64 buffer_tail{}; | 24 | s64 buffer_tail{}; |
| 26 | s64 buffer_count{}; | 25 | s64 buffer_count{}; |
| 27 | std::array<AtomicStorage<State>, max_buffer_size> entries{}; | 26 | std::array<AtomicStorage<State>, max_buffer_size> entries{}; |
| @@ -35,11 +34,11 @@ struct Lifo { | |||
| 35 | } | 34 | } |
| 36 | 35 | ||
| 37 | std::size_t GetPreviousEntryIndex() const { | 36 | std::size_t GetPreviousEntryIndex() const { |
| 38 | return (buffer_tail + total_buffer_count - 1) % total_buffer_count; | 37 | return static_cast<size_t>((buffer_tail + total_buffer_count - 1) % total_buffer_count); |
| 39 | } | 38 | } |
| 40 | 39 | ||
| 41 | std::size_t GetNextEntryIndex() const { | 40 | std::size_t GetNextEntryIndex() const { |
| 42 | return (buffer_tail + 1) % total_buffer_count; | 41 | return static_cast<size_t>((buffer_tail + 1) % total_buffer_count); |
| 43 | } | 42 | } |
| 44 | 43 | ||
| 45 | void WriteNextEntry(const State& new_state) { | 44 | void WriteNextEntry(const State& new_state) { |
diff --git a/src/input_common/drivers/gc_adapter.cpp b/src/input_common/drivers/gc_adapter.cpp index 2550f8cba..a1b9b6d98 100644 --- a/src/input_common/drivers/gc_adapter.cpp +++ b/src/input_common/drivers/gc_adapter.cpp | |||
| @@ -69,7 +69,7 @@ private: | |||
| 69 | libusb_device_handle* handle{}; | 69 | libusb_device_handle* handle{}; |
| 70 | }; | 70 | }; |
| 71 | 71 | ||
| 72 | GCAdapter::GCAdapter(const std::string input_engine_) : InputEngine(input_engine_) { | 72 | GCAdapter::GCAdapter(const std::string& input_engine_) : InputEngine(input_engine_) { |
| 73 | if (usb_adapter_handle) { | 73 | if (usb_adapter_handle) { |
| 74 | return; | 74 | return; |
| 75 | } | 75 | } |
| @@ -486,42 +486,30 @@ std::string GCAdapter::GetUIButtonName(const Common::ParamPackage& params) const | |||
| 486 | switch (button) { | 486 | switch (button) { |
| 487 | case PadButton::ButtonLeft: | 487 | case PadButton::ButtonLeft: |
| 488 | return "left"; | 488 | return "left"; |
| 489 | break; | ||
| 490 | case PadButton::ButtonRight: | 489 | case PadButton::ButtonRight: |
| 491 | return "right"; | 490 | return "right"; |
| 492 | break; | ||
| 493 | case PadButton::ButtonDown: | 491 | case PadButton::ButtonDown: |
| 494 | return "down"; | 492 | return "down"; |
| 495 | break; | ||
| 496 | case PadButton::ButtonUp: | 493 | case PadButton::ButtonUp: |
| 497 | return "up"; | 494 | return "up"; |
| 498 | break; | ||
| 499 | case PadButton::TriggerZ: | 495 | case PadButton::TriggerZ: |
| 500 | return "Z"; | 496 | return "Z"; |
| 501 | break; | ||
| 502 | case PadButton::TriggerR: | 497 | case PadButton::TriggerR: |
| 503 | return "R"; | 498 | return "R"; |
| 504 | break; | ||
| 505 | case PadButton::TriggerL: | 499 | case PadButton::TriggerL: |
| 506 | return "L"; | 500 | return "L"; |
| 507 | break; | ||
| 508 | case PadButton::ButtonA: | 501 | case PadButton::ButtonA: |
| 509 | return "A"; | 502 | return "A"; |
| 510 | break; | ||
| 511 | case PadButton::ButtonB: | 503 | case PadButton::ButtonB: |
| 512 | return "B"; | 504 | return "B"; |
| 513 | break; | ||
| 514 | case PadButton::ButtonX: | 505 | case PadButton::ButtonX: |
| 515 | return "X"; | 506 | return "X"; |
| 516 | break; | ||
| 517 | case PadButton::ButtonY: | 507 | case PadButton::ButtonY: |
| 518 | return "Y"; | 508 | return "Y"; |
| 519 | break; | ||
| 520 | case PadButton::ButtonStart: | 509 | case PadButton::ButtonStart: |
| 521 | return "start"; | 510 | return "start"; |
| 522 | break; | ||
| 523 | default: | 511 | default: |
| 524 | return "Unkown GC"; | 512 | return "Unknown GC"; |
| 525 | } | 513 | } |
| 526 | } | 514 | } |
| 527 | 515 | ||
diff --git a/src/input_common/drivers/gc_adapter.h b/src/input_common/drivers/gc_adapter.h index fba90352e..3e4747040 100644 --- a/src/input_common/drivers/gc_adapter.h +++ b/src/input_common/drivers/gc_adapter.h | |||
| @@ -24,7 +24,7 @@ class LibUSBDeviceHandle; | |||
| 24 | 24 | ||
| 25 | class GCAdapter : public InputCommon::InputEngine { | 25 | class GCAdapter : public InputCommon::InputEngine { |
| 26 | public: | 26 | public: |
| 27 | explicit GCAdapter(const std::string input_engine_); | 27 | explicit GCAdapter(const std::string& input_engine_); |
| 28 | ~GCAdapter(); | 28 | ~GCAdapter(); |
| 29 | 29 | ||
| 30 | Common::Input::VibrationError SetRumble( | 30 | Common::Input::VibrationError SetRumble( |
diff --git a/src/input_common/drivers/mouse.cpp b/src/input_common/drivers/mouse.cpp index 05fd7f9c0..9a9a1987d 100644 --- a/src/input_common/drivers/mouse.cpp +++ b/src/input_common/drivers/mouse.cpp | |||
| @@ -24,7 +24,7 @@ constexpr PadIdentifier identifier = { | |||
| 24 | .pad = 0, | 24 | .pad = 0, |
| 25 | }; | 25 | }; |
| 26 | 26 | ||
| 27 | Mouse::Mouse(const std::string input_engine_) : InputEngine(input_engine_) { | 27 | Mouse::Mouse(const std::string& input_engine_) : InputEngine(input_engine_) { |
| 28 | PreSetController(identifier); | 28 | PreSetController(identifier); |
| 29 | PreSetAxis(identifier, mouse_axis_x); | 29 | PreSetAxis(identifier, mouse_axis_x); |
| 30 | PreSetAxis(identifier, mouse_axis_y); | 30 | PreSetAxis(identifier, mouse_axis_y); |
diff --git a/src/input_common/drivers/mouse.h b/src/input_common/drivers/mouse.h index f7e6db0b5..11dd76e14 100644 --- a/src/input_common/drivers/mouse.h +++ b/src/input_common/drivers/mouse.h | |||
| @@ -29,7 +29,7 @@ enum class MouseButton { | |||
| 29 | */ | 29 | */ |
| 30 | class Mouse final : public InputCommon::InputEngine { | 30 | class Mouse final : public InputCommon::InputEngine { |
| 31 | public: | 31 | public: |
| 32 | explicit Mouse(const std::string input_engine_); | 32 | explicit Mouse(const std::string& input_engine_); |
| 33 | 33 | ||
| 34 | /** | 34 | /** |
| 35 | * Signals that mouse has moved. | 35 | * Signals that mouse has moved. |
diff --git a/src/input_common/drivers/sdl_driver.cpp b/src/input_common/drivers/sdl_driver.cpp index 1e3741e0f..0b24f1858 100644 --- a/src/input_common/drivers/sdl_driver.cpp +++ b/src/input_common/drivers/sdl_driver.cpp | |||
| @@ -929,7 +929,7 @@ std::string SDLDriver::GetHatButtonName(u8 direction_value) const { | |||
| 929 | } | 929 | } |
| 930 | } | 930 | } |
| 931 | 931 | ||
| 932 | u8 SDLDriver::GetHatButtonId(const std::string direction_name) const { | 932 | u8 SDLDriver::GetHatButtonId(const std::string& direction_name) const { |
| 933 | Uint8 direction; | 933 | Uint8 direction; |
| 934 | if (direction_name == "up") { | 934 | if (direction_name == "up") { |
| 935 | direction = SDL_HAT_UP; | 935 | direction = SDL_HAT_UP; |
diff --git a/src/input_common/drivers/sdl_driver.h b/src/input_common/drivers/sdl_driver.h index b879df8ab..3faaca984 100644 --- a/src/input_common/drivers/sdl_driver.h +++ b/src/input_common/drivers/sdl_driver.h | |||
| @@ -56,7 +56,7 @@ public: | |||
| 56 | std::string GetUIName(const Common::ParamPackage& params) const override; | 56 | std::string GetUIName(const Common::ParamPackage& params) const override; |
| 57 | 57 | ||
| 58 | std::string GetHatButtonName(u8 direction_value) const override; | 58 | std::string GetHatButtonName(u8 direction_value) const override; |
| 59 | u8 GetHatButtonId(const std::string direction_name) const override; | 59 | u8 GetHatButtonId(const std::string& direction_name) const override; |
| 60 | 60 | ||
| 61 | Common::Input::VibrationError SetRumble( | 61 | Common::Input::VibrationError SetRumble( |
| 62 | const PadIdentifier& identifier, const Common::Input::VibrationStatus vibration) override; | 62 | const PadIdentifier& identifier, const Common::Input::VibrationStatus vibration) override; |
diff --git a/src/input_common/drivers/tas_input.cpp b/src/input_common/drivers/tas_input.cpp index bb9c236ea..0e01fb0d9 100644 --- a/src/input_common/drivers/tas_input.cpp +++ b/src/input_common/drivers/tas_input.cpp | |||
| @@ -47,7 +47,7 @@ constexpr std::array<std::pair<std::string_view, TasButton>, 20> text_to_tas_but | |||
| 47 | {"KEY_ZR", TasButton::TRIGGER_ZR}, | 47 | {"KEY_ZR", TasButton::TRIGGER_ZR}, |
| 48 | }; | 48 | }; |
| 49 | 49 | ||
| 50 | Tas::Tas(const std::string input_engine_) : InputCommon::InputEngine(input_engine_) { | 50 | Tas::Tas(const std::string& input_engine_) : InputCommon::InputEngine(input_engine_) { |
| 51 | for (size_t player_index = 0; player_index < PLAYER_NUMBER; player_index++) { | 51 | for (size_t player_index = 0; player_index < PLAYER_NUMBER; player_index++) { |
| 52 | PadIdentifier identifier{ | 52 | PadIdentifier identifier{ |
| 53 | .guid = Common::UUID{}, | 53 | .guid = Common::UUID{}, |
diff --git a/src/input_common/drivers/tas_input.h b/src/input_common/drivers/tas_input.h index bfb37a638..c95a130fc 100644 --- a/src/input_common/drivers/tas_input.h +++ b/src/input_common/drivers/tas_input.h | |||
| @@ -83,7 +83,7 @@ enum class TasState { | |||
| 83 | 83 | ||
| 84 | class Tas final : public InputCommon::InputEngine { | 84 | class Tas final : public InputCommon::InputEngine { |
| 85 | public: | 85 | public: |
| 86 | explicit Tas(const std::string input_engine_); | 86 | explicit Tas(const std::string& input_engine_); |
| 87 | ~Tas(); | 87 | ~Tas(); |
| 88 | 88 | ||
| 89 | /** | 89 | /** |
diff --git a/src/input_common/drivers/touch_screen.cpp b/src/input_common/drivers/touch_screen.cpp index 377c9ee2b..45b3086f6 100644 --- a/src/input_common/drivers/touch_screen.cpp +++ b/src/input_common/drivers/touch_screen.cpp | |||
| @@ -13,7 +13,7 @@ constexpr PadIdentifier identifier = { | |||
| 13 | .pad = 0, | 13 | .pad = 0, |
| 14 | }; | 14 | }; |
| 15 | 15 | ||
| 16 | TouchScreen::TouchScreen(const std::string input_engine_) : InputEngine(input_engine_) { | 16 | TouchScreen::TouchScreen(const std::string& input_engine_) : InputEngine(input_engine_) { |
| 17 | PreSetController(identifier); | 17 | PreSetController(identifier); |
| 18 | } | 18 | } |
| 19 | 19 | ||
diff --git a/src/input_common/drivers/touch_screen.h b/src/input_common/drivers/touch_screen.h index 0f4cd0e7a..25c11e8bf 100644 --- a/src/input_common/drivers/touch_screen.h +++ b/src/input_common/drivers/touch_screen.h | |||
| @@ -14,7 +14,7 @@ namespace InputCommon { | |||
| 14 | */ | 14 | */ |
| 15 | class TouchScreen final : public InputCommon::InputEngine { | 15 | class TouchScreen final : public InputCommon::InputEngine { |
| 16 | public: | 16 | public: |
| 17 | explicit TouchScreen(const std::string input_engine_); | 17 | explicit TouchScreen(const std::string& input_engine_); |
| 18 | 18 | ||
| 19 | /** | 19 | /** |
| 20 | * Signals that mouse has moved. | 20 | * Signals that mouse has moved. |
diff --git a/src/input_common/input_engine.cpp b/src/input_common/input_engine.cpp index 139d8d2e6..2b2105376 100644 --- a/src/input_common/input_engine.cpp +++ b/src/input_common/input_engine.cpp | |||
| @@ -300,8 +300,8 @@ void InputEngine::TriggerOnMotionChange(const PadIdentifier& identifier, int mot | |||
| 300 | if (!configuring || !mapping_callback.on_data) { | 300 | if (!configuring || !mapping_callback.on_data) { |
| 301 | return; | 301 | return; |
| 302 | } | 302 | } |
| 303 | if (std::abs(value.gyro_x) < 1.0f && std::abs(value.gyro_y) < 1.0f && | 303 | if (std::abs(value.gyro_x) < 0.6f && std::abs(value.gyro_y) < 0.6f && |
| 304 | std::abs(value.gyro_z) < 1.0f) { | 304 | std::abs(value.gyro_z) < 0.6f) { |
| 305 | return; | 305 | return; |
| 306 | } | 306 | } |
| 307 | mapping_callback.on_data(MappingData{ | 307 | mapping_callback.on_data(MappingData{ |
diff --git a/src/input_common/input_engine.h b/src/input_common/input_engine.h index 5430c0cf8..c621686e5 100644 --- a/src/input_common/input_engine.h +++ b/src/input_common/input_engine.h | |||
| @@ -166,7 +166,7 @@ public: | |||
| 166 | }; | 166 | }; |
| 167 | 167 | ||
| 168 | /// Retrieves the index number of the given hat button direction | 168 | /// Retrieves the index number of the given hat button direction |
| 169 | virtual u8 GetHatButtonId([[maybe_unused]] const std::string direction_name) const { | 169 | virtual u8 GetHatButtonId([[maybe_unused]] const std::string& direction_name) const { |
| 170 | return 0; | 170 | return 0; |
| 171 | }; | 171 | }; |
| 172 | 172 | ||
diff --git a/src/yuzu/bootmanager.cpp b/src/yuzu/bootmanager.cpp index 2313a4189..7390fc5bd 100644 --- a/src/yuzu/bootmanager.cpp +++ b/src/yuzu/bootmanager.cpp | |||
| @@ -613,56 +613,56 @@ int GRenderWindow::QtKeyToSwitchKey(Qt::Key qt_key) { | |||
| 613 | } | 613 | } |
| 614 | } | 614 | } |
| 615 | 615 | ||
| 616 | int GRenderWindow::QtModifierToSwitchModdifier(quint32 qt_moddifiers) { | 616 | int GRenderWindow::QtModifierToSwitchModifier(quint32 qt_modifiers) { |
| 617 | int moddifier = 0; | 617 | int modifier = 0; |
| 618 | // The values are obtained through testing, Qt doesn't seem to provide a proper enum | 618 | // The values are obtained through testing, Qt doesn't seem to provide a proper enum |
| 619 | if ((qt_moddifiers & 0x1) != 0) { | 619 | if ((qt_modifiers & 0x1) != 0) { |
| 620 | moddifier |= 1 << Settings::NativeKeyboard::LeftShift; | 620 | modifier |= 1 << Settings::NativeKeyboard::LeftShift; |
| 621 | } | 621 | } |
| 622 | if ((qt_moddifiers & 0x2) != 0) { | 622 | if ((qt_modifiers & 0x2) != 0) { |
| 623 | moddifier |= 1 << Settings::NativeKeyboard::LeftControl; | 623 | modifier |= 1 << Settings::NativeKeyboard::LeftControl; |
| 624 | } | 624 | } |
| 625 | if ((qt_moddifiers & 0x4) != 0) { | 625 | if ((qt_modifiers & 0x4) != 0) { |
| 626 | moddifier |= 1 << Settings::NativeKeyboard::LeftAlt; | 626 | modifier |= 1 << Settings::NativeKeyboard::LeftAlt; |
| 627 | } | 627 | } |
| 628 | if ((qt_moddifiers & 0x08) != 0) { | 628 | if ((qt_modifiers & 0x08) != 0) { |
| 629 | moddifier |= 1 << Settings::NativeKeyboard::LeftMeta; | 629 | modifier |= 1 << Settings::NativeKeyboard::LeftMeta; |
| 630 | } | 630 | } |
| 631 | if ((qt_moddifiers & 0x10) != 0) { | 631 | if ((qt_modifiers & 0x10) != 0) { |
| 632 | moddifier |= 1 << Settings::NativeKeyboard::RightShift; | 632 | modifier |= 1 << Settings::NativeKeyboard::RightShift; |
| 633 | } | 633 | } |
| 634 | if ((qt_moddifiers & 0x20) != 0) { | 634 | if ((qt_modifiers & 0x20) != 0) { |
| 635 | moddifier |= 1 << Settings::NativeKeyboard::RightControl; | 635 | modifier |= 1 << Settings::NativeKeyboard::RightControl; |
| 636 | } | 636 | } |
| 637 | if ((qt_moddifiers & 0x40) != 0) { | 637 | if ((qt_modifiers & 0x40) != 0) { |
| 638 | moddifier |= 1 << Settings::NativeKeyboard::RightAlt; | 638 | modifier |= 1 << Settings::NativeKeyboard::RightAlt; |
| 639 | } | 639 | } |
| 640 | if ((qt_moddifiers & 0x80) != 0) { | 640 | if ((qt_modifiers & 0x80) != 0) { |
| 641 | moddifier |= 1 << Settings::NativeKeyboard::RightMeta; | 641 | modifier |= 1 << Settings::NativeKeyboard::RightMeta; |
| 642 | } | 642 | } |
| 643 | if ((qt_moddifiers & 0x100) != 0) { | 643 | if ((qt_modifiers & 0x100) != 0) { |
| 644 | moddifier |= 1 << Settings::NativeKeyboard::CapsLock; | 644 | modifier |= 1 << Settings::NativeKeyboard::CapsLock; |
| 645 | } | 645 | } |
| 646 | if ((qt_moddifiers & 0x200) != 0) { | 646 | if ((qt_modifiers & 0x200) != 0) { |
| 647 | moddifier |= 1 << Settings::NativeKeyboard::NumLock; | 647 | modifier |= 1 << Settings::NativeKeyboard::NumLock; |
| 648 | } | 648 | } |
| 649 | // Verify the last two keys | 649 | // Verify the last two keys |
| 650 | if ((qt_moddifiers & 0x400) != 0) { | 650 | if ((qt_modifiers & 0x400) != 0) { |
| 651 | moddifier |= 1 << Settings::NativeKeyboard::Katakana; | 651 | modifier |= 1 << Settings::NativeKeyboard::Katakana; |
| 652 | } | 652 | } |
| 653 | if ((qt_moddifiers & 0x800) != 0) { | 653 | if ((qt_modifiers & 0x800) != 0) { |
| 654 | moddifier |= 1 << Settings::NativeKeyboard::Hiragana; | 654 | modifier |= 1 << Settings::NativeKeyboard::Hiragana; |
| 655 | } | 655 | } |
| 656 | return moddifier; | 656 | return modifier; |
| 657 | } | 657 | } |
| 658 | 658 | ||
| 659 | void GRenderWindow::keyPressEvent(QKeyEvent* event) { | 659 | void GRenderWindow::keyPressEvent(QKeyEvent* event) { |
| 660 | if (!event->isAutoRepeat()) { | 660 | if (!event->isAutoRepeat()) { |
| 661 | const auto moddifier = QtModifierToSwitchModdifier(event->nativeModifiers()); | 661 | const auto modifier = QtModifierToSwitchModifier(event->nativeModifiers()); |
| 662 | // Replace event->key() with event->nativeVirtualKey() since the second one provides raw key | 662 | // Replace event->key() with event->nativeVirtualKey() since the second one provides raw key |
| 663 | // buttons | 663 | // buttons |
| 664 | const auto key = QtKeyToSwitchKey(Qt::Key(event->key())); | 664 | const auto key = QtKeyToSwitchKey(Qt::Key(event->key())); |
| 665 | input_subsystem->GetKeyboard()->SetKeyboardModifiers(moddifier); | 665 | input_subsystem->GetKeyboard()->SetKeyboardModifiers(modifier); |
| 666 | input_subsystem->GetKeyboard()->PressKeyboardKey(key); | 666 | input_subsystem->GetKeyboard()->PressKeyboardKey(key); |
| 667 | // This is used for gamepads | 667 | // This is used for gamepads |
| 668 | input_subsystem->GetKeyboard()->PressKey(event->key()); | 668 | input_subsystem->GetKeyboard()->PressKey(event->key()); |
| @@ -671,9 +671,9 @@ void GRenderWindow::keyPressEvent(QKeyEvent* event) { | |||
| 671 | 671 | ||
| 672 | void GRenderWindow::keyReleaseEvent(QKeyEvent* event) { | 672 | void GRenderWindow::keyReleaseEvent(QKeyEvent* event) { |
| 673 | if (!event->isAutoRepeat()) { | 673 | if (!event->isAutoRepeat()) { |
| 674 | const auto moddifier = QtModifierToSwitchModdifier(event->nativeModifiers()); | 674 | const auto modifier = QtModifierToSwitchModifier(event->nativeModifiers()); |
| 675 | const auto key = QtKeyToSwitchKey(Qt::Key(event->key())); | 675 | const auto key = QtKeyToSwitchKey(Qt::Key(event->key())); |
| 676 | input_subsystem->GetKeyboard()->SetKeyboardModifiers(moddifier); | 676 | input_subsystem->GetKeyboard()->SetKeyboardModifiers(modifier); |
| 677 | input_subsystem->GetKeyboard()->ReleaseKeyboardKey(key); | 677 | input_subsystem->GetKeyboard()->ReleaseKeyboardKey(key); |
| 678 | // This is used for gamepads | 678 | // This is used for gamepads |
| 679 | input_subsystem->GetKeyboard()->ReleaseKey(event->key()); | 679 | input_subsystem->GetKeyboard()->ReleaseKey(event->key()); |
| @@ -747,8 +747,8 @@ void GRenderWindow::mouseReleaseEvent(QMouseEvent* event) { | |||
| 747 | } | 747 | } |
| 748 | 748 | ||
| 749 | void GRenderWindow::wheelEvent(QWheelEvent* event) { | 749 | void GRenderWindow::wheelEvent(QWheelEvent* event) { |
| 750 | const int x = event->delta(); | 750 | const int x = event->angleDelta().x(); |
| 751 | const int y = 0; | 751 | const int y = event->angleDelta().y(); |
| 752 | input_subsystem->GetMouse()->MouseWheelChange(x, y); | 752 | input_subsystem->GetMouse()->MouseWheelChange(x, y); |
| 753 | } | 753 | } |
| 754 | 754 | ||
diff --git a/src/yuzu/bootmanager.h b/src/yuzu/bootmanager.h index d6b2ab5f3..81e3c4eb0 100644 --- a/src/yuzu/bootmanager.h +++ b/src/yuzu/bootmanager.h | |||
| @@ -162,7 +162,7 @@ public: | |||
| 162 | static int QtKeyToSwitchKey(Qt::Key qt_keys); | 162 | static int QtKeyToSwitchKey(Qt::Key qt_keys); |
| 163 | 163 | ||
| 164 | /// Converts a Qt modifier keys into NativeKeyboard modifier keys | 164 | /// Converts a Qt modifier keys into NativeKeyboard modifier keys |
| 165 | static int QtModifierToSwitchModdifier(quint32 qt_moddifiers); | 165 | static int QtModifierToSwitchModifier(quint32 qt_modifiers); |
| 166 | 166 | ||
| 167 | void keyPressEvent(QKeyEvent* event) override; | 167 | void keyPressEvent(QKeyEvent* event) override; |
| 168 | void keyReleaseEvent(QKeyEvent* event) override; | 168 | void keyReleaseEvent(QKeyEvent* event) override; |