summaryrefslogtreecommitdiff
path: root/src/input_common
diff options
context:
space:
mode:
Diffstat (limited to 'src/input_common')
-rw-r--r--src/input_common/main.cpp8
-rw-r--r--src/input_common/main.h2
-rw-r--r--src/input_common/touch_from_button.cpp7
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 {
175 return impl->gcbuttons.get(); 175 return impl->gcbuttons.get();
176} 176}
177 177
178void ReloadInputDevices() { 178void InputSubsystem::ReloadInputDevices() {
179 if (udp) 179 if (!impl->udp) {
180 udp->ReloadUDPClient(); 180 return;
181 }
182 impl->udp->ReloadUDPClient();
181} 183}
182 184
183std::vector<std::unique_ptr<Polling::DevicePoller>> InputSubsystem::GetPollers( 185std::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:
118 /// Retrieves the underlying GameCube button handler. 118 /// Retrieves the underlying GameCube button handler.
119 [[nodiscard]] const GCButtonFactory* GetGCButtons() const; 119 [[nodiscard]] const GCButtonFactory* GetGCButtons() const;
120 120
121 void ReloadInputDevices();
122
121 /// Get all DevicePoller from all backends for a specific device type 123 /// Get all DevicePoller from all backends for a specific device type
122 [[nodiscard]] std::vector<std::unique_ptr<Polling::DevicePoller>> GetPollers( 124 [[nodiscard]] std::vector<std::unique_ptr<Polling::DevicePoller>> GetPollers(
123 Polling::DeviceType type) const; 125 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:
30 static_cast<int>(Layout::ScreenUndocked::Width); 30 static_cast<int>(Layout::ScreenUndocked::Width);
31 const float y = static_cast<float>(std::get<2>(m)) / 31 const float y = static_cast<float>(std::get<2>(m)) /
32 static_cast<int>(Layout::ScreenUndocked::Height); 32 static_cast<int>(Layout::ScreenUndocked::Height);
33 return std::make_tuple(x, y, true); 33 return {x, y, true};
34 } 34 }
35 } 35 }
36 return std::make_tuple(0.0f, 0.0f, false); 36 return {};
37 } 37 }
38 38
39private: 39private:
40 std::vector<std::tuple<std::unique_ptr<Input::ButtonDevice>, int, int>> map; // button, x, y 40 // A vector of the mapped button, its x and its y-coordinate
41 std::vector<std::tuple<std::unique_ptr<Input::ButtonDevice>, int, int>> map;
41}; 42};
42 43
43std::unique_ptr<Input::TouchDevice> TouchFromButtonFactory::Create( 44std::unique_ptr<Input::TouchDevice> TouchFromButtonFactory::Create(