diff options
author | 2016-09-20 12:19:58 -0700 | |
---|---|---|
committer | 2016-09-20 12:19:58 -0700 | |
commit | 845b36dae268242ab4a103ceb39520efdfa89018 (patch) | |
tree | eca831bad8973be7ba3f449f16185619088c50a3 /src/osd/modules/input/input_dinput.cpp | |
parent | 32ea8266a31080330a6fd84208997dc24b7368fc (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_dinput.cpp')
-rw-r--r-- | src/osd/modules/input/input_dinput.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/osd/modules/input/input_dinput.cpp b/src/osd/modules/input/input_dinput.cpp index 01e920f2953..b17cf3a61a3 100644 --- a/src/osd/modules/input/input_dinput.cpp +++ b/src/osd/modules/input/input_dinput.cpp @@ -68,8 +68,8 @@ static HRESULT dinput_set_dword_property(ComPtr<IDirectInputDevice> device, REFG // dinput_device - base directinput device //============================================================ -dinput_device::dinput_device(running_machine &machine, const char *name, input_device_class deviceclass, input_module &module) - : device_info(machine, name, deviceclass, module), +dinput_device::dinput_device(running_machine &machine, const char *name, const char *id, input_device_class deviceclass, input_module &module) + : device_info(machine, name, id, deviceclass, module), dinput({nullptr}) { } @@ -110,8 +110,8 @@ HRESULT dinput_device::poll_dinput(LPVOID pState) const // dinput_keyboard_device - directinput keyboard device //============================================================ -dinput_keyboard_device::dinput_keyboard_device(running_machine &machine, const char *name, input_module &module) - : dinput_device(machine, name, DEVICE_CLASS_KEYBOARD, module), +dinput_keyboard_device::dinput_keyboard_device(running_machine &machine, const char *name, const char *id, input_module &module) + : dinput_device(machine, name, id, DEVICE_CLASS_KEYBOARD, module), keyboard({{0}}) { } @@ -328,8 +328,8 @@ public: }; -dinput_mouse_device::dinput_mouse_device(running_machine &machine, const char *name, input_module &module) - : dinput_device(machine, name, DEVICE_CLASS_MOUSE, module), +dinput_mouse_device::dinput_mouse_device(running_machine &machine, const char *name, const char *id, input_module &module) + : dinput_device(machine, name, id, DEVICE_CLASS_MOUSE, module), mouse({0}) { } @@ -427,8 +427,8 @@ public: } }; -dinput_joystick_device::dinput_joystick_device(running_machine &machine, const char *name, input_module &module) - : dinput_device(machine, name, DEVICE_CLASS_JOYSTICK, module), +dinput_joystick_device::dinput_joystick_device(running_machine &machine, const char *name, const char *id, input_module &module) + : dinput_device(machine, name, id, DEVICE_CLASS_JOYSTICK, module), joystick({{0}}) { } |