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_win32.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_win32.cpp')
-rw-r--r-- | src/osd/modules/input/input_win32.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/osd/modules/input/input_win32.cpp b/src/osd/modules/input/input_win32.cpp index 78e162f296b..ccae2be2861 100644 --- a/src/osd/modules/input/input_win32.cpp +++ b/src/osd/modules/input/input_win32.cpp @@ -38,8 +38,8 @@ class win32_keyboard_device : public event_based_device<KeyPressEventArgs> public: keyboard_state keyboard; - win32_keyboard_device(running_machine& machine, const char *name, input_module &module) - : event_based_device(machine, name, DEVICE_CLASS_KEYBOARD, module), + win32_keyboard_device(running_machine& machine, const char *name, const char *id, input_module &module) + : event_based_device(machine, name, id, DEVICE_CLASS_KEYBOARD, module), keyboard({{0}}) { } @@ -73,7 +73,7 @@ public: virtual void input_init(running_machine &machine) override { // Add a single win32 keyboard device that we'll monitor using Win32 - win32_keyboard_device *devinfo = devicelist()->create_device<win32_keyboard_device>(machine, "Win32 Keyboard 1", *this); + win32_keyboard_device *devinfo = devicelist()->create_device<win32_keyboard_device>(machine, "Win32 Keyboard 1", "Win32 Keyboard 1", *this); keyboard_trans_table &table = keyboard_trans_table::instance(); @@ -133,8 +133,8 @@ public: mouse_state mouse; win32_mouse_state win32_mouse; - win32_mouse_device(running_machine& machine, const char *name, input_module &module) - : event_based_device(machine, name, DEVICE_CLASS_MOUSE, module), + win32_mouse_device(running_machine& machine, const char *name, const char *id, input_module &module) + : event_based_device(machine, name, id, DEVICE_CLASS_MOUSE, module), mouse({0}), win32_mouse({{0}}) { @@ -206,7 +206,7 @@ public: return; // allocate a device - devinfo = devicelist()->create_device<win32_mouse_device>(machine, "Win32 Mouse 1", *this); + devinfo = devicelist()->create_device<win32_mouse_device>(machine, "Win32 Mouse 1", "Win32 Mouse 1", *this); if (devinfo == nullptr) return; @@ -261,8 +261,8 @@ private: public: mouse_state mouse; - win32_lightgun_device(running_machine& machine, const char *name, input_module &module) - : event_based_device(machine, name, DEVICE_CLASS_LIGHTGUN, module), + win32_lightgun_device(running_machine& machine, const char *name, const char *id, input_module &module) + : event_based_device(machine, name, id, DEVICE_CLASS_LIGHTGUN, module), m_lightgun_shared_axis_mode(FALSE), m_gun_index(0), mouse({0}) @@ -393,7 +393,7 @@ public: int axisnum, butnum; // allocate a device - devinfo = devicelist()->create_device<win32_lightgun_device>(machine, gun_names[gunnum], *this); + devinfo = devicelist()->create_device<win32_lightgun_device>(machine, gun_names[gunnum], gun_names[gunnum], *this); if (devinfo == nullptr) break; |