aboutsummaryrefslogtreecommitdiff
path: root/src/core/hid/emulated_devices.cpp
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2022-11-28 09:19:01 -0500
committerLioncash <mathew1800@gmail.com>2022-11-28 10:00:37 -0500
commit2ec7d0b5fda0fe6cbafcc235e3d8cc91b0dc81e0 (patch)
treec61fdcf120b96a0487e24f16c6f48b5fb44fafb5 /src/core/hid/emulated_devices.cpp
parent7f42432f4205185f474733335c8a4eef26992454 (diff)
common/input: Add helpers functions for creating input and output devices
Avoids the redundancy of needing to explictly specify the common namespace and the type.
Diffstat (limited to 'src/core/hid/emulated_devices.cpp')
-rw-r--r--src/core/hid/emulated_devices.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/core/hid/emulated_devices.cpp b/src/core/hid/emulated_devices.cpp
index 658dbd3182..e421828d25 100644
--- a/src/core/hid/emulated_devices.cpp
+++ b/src/core/hid/emulated_devices.cpp
@@ -25,12 +25,12 @@ void EmulatedDevices::ReloadInput() {
Common::ParamPackage mouse_params;
mouse_params.Set("engine", "mouse");
mouse_params.Set("button", static_cast<int>(key_index));
- mouse_device = Common::Input::CreateDevice<Common::Input::InputDevice>(mouse_params);
+ mouse_device = Common::Input::CreateInputDevice(mouse_params);
key_index++;
}
- mouse_stick_device = Common::Input::CreateDeviceFromString<Common::Input::InputDevice>(
- "engine:mouse,axis_x:0,axis_y:1");
+ mouse_stick_device =
+ Common::Input::CreateInputDeviceFromString("engine:mouse,axis_x:0,axis_y:1");
// First two axis are reserved for mouse position
key_index = 2;
@@ -38,7 +38,7 @@ void EmulatedDevices::ReloadInput() {
Common::ParamPackage mouse_params;
mouse_params.Set("engine", "mouse");
mouse_params.Set("axis", static_cast<int>(key_index));
- mouse_device = Common::Input::CreateDevice<Common::Input::InputDevice>(mouse_params);
+ mouse_device = Common::Input::CreateInputDevice(mouse_params);
key_index++;
}
@@ -50,7 +50,7 @@ void EmulatedDevices::ReloadInput() {
keyboard_params.Set("button", static_cast<int>(key_index));
keyboard_params.Set("port", 1);
keyboard_params.Set("pad", 0);
- keyboard_device = Common::Input::CreateDevice<Common::Input::InputDevice>(keyboard_params);
+ keyboard_device = Common::Input::CreateInputDevice(keyboard_params);
key_index++;
}
@@ -62,11 +62,11 @@ void EmulatedDevices::ReloadInput() {
keyboard_params.Set("button", static_cast<int>(key_index));
keyboard_params.Set("port", 1);
keyboard_params.Set("pad", 1);
- keyboard_device = Common::Input::CreateDevice<Common::Input::InputDevice>(keyboard_params);
+ keyboard_device = Common::Input::CreateInputDevice(keyboard_params);
key_index++;
}
- ring_analog_device = Common::Input::CreateDevice<Common::Input::InputDevice>(ring_params);
+ ring_analog_device = Common::Input::CreateInputDevice(ring_params);
for (std::size_t index = 0; index < mouse_button_devices.size(); ++index) {
if (!mouse_button_devices[index]) {