summaryrefslogtreecommitdiff
path: root/src/input_common
diff options
context:
space:
mode:
Diffstat (limited to 'src/input_common')
-rw-r--r--src/input_common/drivers/keyboard.cpp6
-rw-r--r--src/input_common/drivers/keyboard.h7
-rw-r--r--src/input_common/drivers/mouse.cpp5
-rw-r--r--src/input_common/drivers/mouse.h5
-rw-r--r--src/input_common/drivers/touch_screen.cpp6
-rw-r--r--src/input_common/drivers/touch_screen.h8
-rw-r--r--src/input_common/input_engine.cpp5
7 files changed, 21 insertions, 21 deletions
diff --git a/src/input_common/drivers/keyboard.cpp b/src/input_common/drivers/keyboard.cpp
index 85a781a30..549704e89 100644
--- a/src/input_common/drivers/keyboard.cpp
+++ b/src/input_common/drivers/keyboard.cpp
@@ -7,6 +7,12 @@
7 7
8namespace InputCommon { 8namespace InputCommon {
9 9
10constexpr PadIdentifier identifier = {
11 .guid = Common::UUID{Common::INVALID_UUID},
12 .port = 0,
13 .pad = 0,
14};
15
10Keyboard::Keyboard(const std::string& input_engine_) : InputEngine(input_engine_) { 16Keyboard::Keyboard(const std::string& input_engine_) : InputEngine(input_engine_) {
11 PreSetController(identifier); 17 PreSetController(identifier);
12} 18}
diff --git a/src/input_common/drivers/keyboard.h b/src/input_common/drivers/keyboard.h
index 58df15050..46fe78576 100644
--- a/src/input_common/drivers/keyboard.h
+++ b/src/input_common/drivers/keyboard.h
@@ -32,13 +32,6 @@ public:
32 32
33 /// Used for automapping features 33 /// Used for automapping features
34 std::vector<Common::ParamPackage> GetInputDevices() const override; 34 std::vector<Common::ParamPackage> GetInputDevices() const override;
35
36private:
37 const PadIdentifier identifier = {
38 .guid = Common::UUID{Common::INVALID_UUID},
39 .port = 0,
40 .pad = 0,
41 };
42}; 35};
43 36
44} // namespace InputCommon 37} // namespace InputCommon
diff --git a/src/input_common/drivers/mouse.cpp b/src/input_common/drivers/mouse.cpp
index 1c32b54be..afa92b458 100644
--- a/src/input_common/drivers/mouse.cpp
+++ b/src/input_common/drivers/mouse.cpp
@@ -14,6 +14,11 @@
14namespace InputCommon { 14namespace InputCommon {
15constexpr int touch_axis_x = 10; 15constexpr int touch_axis_x = 10;
16constexpr int touch_axis_y = 11; 16constexpr int touch_axis_y = 11;
17constexpr PadIdentifier identifier = {
18 .guid = Common::UUID{Common::INVALID_UUID},
19 .port = 0,
20 .pad = 0,
21};
17 22
18Mouse::Mouse(const std::string input_engine_) : InputEngine(input_engine_) { 23Mouse::Mouse(const std::string input_engine_) : InputEngine(input_engine_) {
19 PreSetController(identifier); 24 PreSetController(identifier);
diff --git a/src/input_common/drivers/mouse.h b/src/input_common/drivers/mouse.h
index cf0918409..1be362b94 100644
--- a/src/input_common/drivers/mouse.h
+++ b/src/input_common/drivers/mouse.h
@@ -62,11 +62,6 @@ private:
62 void UpdateThread(std::stop_token stop_token); 62 void UpdateThread(std::stop_token stop_token);
63 void StopPanning(); 63 void StopPanning();
64 64
65 const PadIdentifier identifier = {
66 .guid = Common::UUID{Common::INVALID_UUID},
67 .port = 0,
68 .pad = 0,
69 };
70 Common::Vec2<int> mouse_origin; 65 Common::Vec2<int> mouse_origin;
71 Common::Vec2<int> last_mouse_position; 66 Common::Vec2<int> last_mouse_position;
72 Common::Vec2<float> last_mouse_change; 67 Common::Vec2<float> last_mouse_change;
diff --git a/src/input_common/drivers/touch_screen.cpp b/src/input_common/drivers/touch_screen.cpp
index e13835e9f..377c9ee2b 100644
--- a/src/input_common/drivers/touch_screen.cpp
+++ b/src/input_common/drivers/touch_screen.cpp
@@ -7,6 +7,12 @@
7 7
8namespace InputCommon { 8namespace InputCommon {
9 9
10constexpr PadIdentifier identifier = {
11 .guid = Common::UUID{Common::INVALID_UUID},
12 .port = 0,
13 .pad = 0,
14};
15
10TouchScreen::TouchScreen(const std::string input_engine_) : InputEngine(input_engine_) { 16TouchScreen::TouchScreen(const std::string input_engine_) : InputEngine(input_engine_) {
11 PreSetController(identifier); 17 PreSetController(identifier);
12} 18}
diff --git a/src/input_common/drivers/touch_screen.h b/src/input_common/drivers/touch_screen.h
index d297d253c..0f4cd0e7a 100644
--- a/src/input_common/drivers/touch_screen.h
+++ b/src/input_common/drivers/touch_screen.h
@@ -37,14 +37,8 @@ public:
37 */ 37 */
38 void TouchReleased(std::size_t finger); 38 void TouchReleased(std::size_t finger);
39 39
40 /// Resets all inputs to their initial value
40 void ReleaseAllTouch(); 41 void ReleaseAllTouch();
41
42private:
43 const PadIdentifier identifier = {
44 .guid = Common::UUID{Common::INVALID_UUID},
45 .port = 0,
46 .pad = 0,
47 };
48}; 42};
49 43
50} // namespace InputCommon 44} // namespace InputCommon
diff --git a/src/input_common/input_engine.cpp b/src/input_common/input_engine.cpp
index 965a2bdf1..139d8d2e6 100644
--- a/src/input_common/input_engine.cpp
+++ b/src/input_common/input_engine.cpp
@@ -353,11 +353,12 @@ void InputEngine::SetMappingCallback(MappingCallback callback) {
353 353
354void InputEngine::DeleteCallback(int key) { 354void InputEngine::DeleteCallback(int key) {
355 std::lock_guard lock{mutex_callback}; 355 std::lock_guard lock{mutex_callback};
356 if (!callback_list.contains(key)) { 356 const auto& iterator = callback_list.find(key);
357 if (iterator == callback_list.end()) {
357 LOG_ERROR(Input, "Tried to delete non-existent callback {}", key); 358 LOG_ERROR(Input, "Tried to delete non-existent callback {}", key);
358 return; 359 return;
359 } 360 }
360 callback_list.erase(key); 361 callback_list.erase(iterator);
361} 362}
362 363
363} // namespace InputCommon 364} // namespace InputCommon