diff options
| author | Léo Lam <leo@innovatetechnologi.es> | 2016-06-13 11:11:47 +0200 |
|---|---|---|
| committer | Léo Lam <leo@innovatetechnologi.es> | 2016-07-29 17:16:22 +0200 |
| commit | 0d783f0869eaef163a318ab4d79744f592ed1cc5 (patch) | |
| tree | 0bf286954d9c3d0c97d8b5ea279810cf69828259 /Source/Core/InputCommon/ControllerInterface/ControllerInterface.h | |
| parent | 2304d769149bfd758d7cf58c4f1735c1c57c8c69 (diff) | |
ControllerInterface: Add a way to register callbacks
This adds RegisterHotplugCallback() to register a callback which will
be invoked by the input backends' hotplug threads when there is a new
device, so that Core (GCKeyboard, GCPad, Wiimote, Hotkey) can reload
the configuration without adding a dependency to Core from InputCommon.
Diffstat (limited to 'Source/Core/InputCommon/ControllerInterface/ControllerInterface.h')
| -rw-r--r-- | Source/Core/InputCommon/ControllerInterface/ControllerInterface.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Source/Core/InputCommon/ControllerInterface/ControllerInterface.h b/Source/Core/InputCommon/ControllerInterface/ControllerInterface.h index 2f4212ba85..24f92fd3c1 100644 --- a/Source/Core/InputCommon/ControllerInterface/ControllerInterface.h +++ b/Source/Core/InputCommon/ControllerInterface/ControllerInterface.h @@ -127,7 +127,11 @@ public: const ciface::Core::DeviceQualifier& default_device) const; void UpdateInput(); + void RegisterHotplugCallback(std::function<void(void)> callback); + void InvokeHotplugCallbacks() const; + private: + std::vector<std::function<void()>> m_hotplug_callbacks; bool m_is_init; void* m_hwnd; }; |
