summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/modules/input/input_xinput.cpp
diff options
context:
space:
mode:
author Tomer Verona <tverona@hotmail.com>2016-09-20 12:19:58 -0700
committer Tomer Verona <tverona@hotmail.com>2016-09-20 12:19:58 -0700
commit845b36dae268242ab4a103ceb39520efdfa89018 (patch)
treeeca831bad8973be7ba3f449f16185619088c50a3 /src/osd/modules/input/input_xinput.cpp
parent32ea8266a31080330a6fd84208997dc24b7368fc (diff)
Adding id() property to input_device
This change adds id() property to input_device, which represents the unique device id. This allows the osd layer when creating a device to pass a friendly display name along with a unique identifier. Currently the device id is only used to map a physical controller device to controller id, but can be used more generally in the future. For raw input devices, we use the full raw input name as the device id. For all other devices, we fall back to device name as the device id. The "uniqueness" of the device id is not currently enforced in code.
Diffstat (limited to 'src/osd/modules/input/input_xinput.cpp')
-rw-r--r--src/osd/modules/input/input_xinput.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/osd/modules/input/input_xinput.cpp b/src/osd/modules/input/input_xinput.cpp
index ba25e4e1cd9..8baf1fd6cdd 100644
--- a/src/osd/modules/input/input_xinput.cpp
+++ b/src/osd/modules/input/input_xinput.cpp
@@ -74,7 +74,7 @@ xinput_joystick_device * xinput_api_helper::create_xinput_device(running_machine
snprintf(device_name, sizeof(device_name), "XInput Player %u", index + 1);
// allocate the device object
- devinfo = module.devicelist()->create_device<xinput_joystick_device>(machine, device_name, module, shared_from_this());
+ devinfo = module.devicelist()->create_device<xinput_joystick_device>(machine, device_name, device_name, module, shared_from_this());
// Set the player ID
devinfo->xinput_state.player_index = index;
@@ -89,8 +89,8 @@ xinput_joystick_device * xinput_api_helper::create_xinput_device(running_machine
// xinput_joystick_device
//============================================================
-xinput_joystick_device::xinput_joystick_device(running_machine &machine, const char *name, input_module &module, std::shared_ptr<xinput_api_helper> helper)
- : device_info(machine, name, DEVICE_CLASS_JOYSTICK, module),
+xinput_joystick_device::xinput_joystick_device(running_machine &machine, const char *name, char const *id, input_module &module, std::shared_ptr<xinput_api_helper> helper)
+ : device_info(machine, name, id, DEVICE_CLASS_JOYSTICK, module),
gamepad({{0}}),
xinput_state({0}),
m_xinput_helper(helper),