diff options
author | FearlessTobi <thm.frey@gmail.com> | 2020-08-29 20:56:51 +0200 |
---|---|---|
committer | FearlessTobi <thm.frey@gmail.com> | 2020-08-29 20:56:51 +0200 |
commit | d176feffad824bce20b694432ade28fe8273c8e4 (patch) | |
tree | a3c6f12346244a3757490327e3ff6e5bed09cbcb /src/input_common | |
parent | yuzu: Add motion and touch configuration (diff) | |
download | yuzu-d176feffad824bce20b694432ade28fe8273c8e4.tar yuzu-d176feffad824bce20b694432ade28fe8273c8e4.tar.gz yuzu-d176feffad824bce20b694432ade28fe8273c8e4.tar.bz2 yuzu-d176feffad824bce20b694432ade28fe8273c8e4.tar.lz yuzu-d176feffad824bce20b694432ade28fe8273c8e4.tar.xz yuzu-d176feffad824bce20b694432ade28fe8273c8e4.tar.zst yuzu-d176feffad824bce20b694432ade28fe8273c8e4.zip |
Diffstat (limited to 'src/input_common')
-rw-r--r-- | src/input_common/main.cpp | 8 | ||||
-rw-r--r-- | src/input_common/main.h | 2 | ||||
-rw-r--r-- | src/input_common/touch_from_button.cpp | 7 |
3 files changed, 11 insertions, 6 deletions
diff --git a/src/input_common/main.cpp b/src/input_common/main.cpp index f9d7b408f..ea1a1cee6 100644 --- a/src/input_common/main.cpp +++ b/src/input_common/main.cpp @@ -175,9 +175,11 @@ const GCButtonFactory* InputSubsystem::GetGCButtons() const { return impl->gcbuttons.get(); } -void ReloadInputDevices() { - if (udp) - udp->ReloadUDPClient(); +void InputSubsystem::ReloadInputDevices() { + if (!impl->udp) { + return; + } + impl->udp->ReloadUDPClient(); } std::vector<std::unique_ptr<Polling::DevicePoller>> InputSubsystem::GetPollers( diff --git a/src/input_common/main.h b/src/input_common/main.h index 269735c43..512215e7e 100644 --- a/src/input_common/main.h +++ b/src/input_common/main.h @@ -118,6 +118,8 @@ public: /// Retrieves the underlying GameCube button handler. [[nodiscard]] const GCButtonFactory* GetGCButtons() const; + void ReloadInputDevices(); + /// Get all DevicePoller from all backends for a specific device type [[nodiscard]] std::vector<std::unique_ptr<Polling::DevicePoller>> GetPollers( Polling::DeviceType type) const; diff --git a/src/input_common/touch_from_button.cpp b/src/input_common/touch_from_button.cpp index 8e7f90253..d028dfa0d 100644 --- a/src/input_common/touch_from_button.cpp +++ b/src/input_common/touch_from_button.cpp @@ -30,14 +30,15 @@ public: static_cast<int>(Layout::ScreenUndocked::Width); const float y = static_cast<float>(std::get<2>(m)) / static_cast<int>(Layout::ScreenUndocked::Height); - return std::make_tuple(x, y, true); + return {x, y, true}; } } - return std::make_tuple(0.0f, 0.0f, false); + return {}; } private: - std::vector<std::tuple<std::unique_ptr<Input::ButtonDevice>, int, int>> map; // button, x, y + // A vector of the mapped button, its x and its y-coordinate + std::vector<std::tuple<std::unique_ptr<Input::ButtonDevice>, int, int>> map; }; std::unique_ptr<Input::TouchDevice> TouchFromButtonFactory::Create( |