diff --git a/Source/Core/Core/HW/GCKeyboard.cpp b/Source/Core/Core/HW/GCKeyboard.cpp index 300ed0608c..b5ec80bf53 100644 --- a/Source/Core/Core/HW/GCKeyboard.cpp +++ b/Source/Core/Core/HW/GCKeyboard.cpp @@ -37,7 +37,7 @@ void Initialize() s_config.CreateController(i); } - g_controller_interface.RegisterHotplugCallback(LoadConfig); + g_controller_interface.RegisterDevicesChangedCallback(LoadConfig); // Load the saved controller config s_config.LoadConfig(true); diff --git a/Source/Core/Core/HW/GCPad.cpp b/Source/Core/Core/HW/GCPad.cpp index fcf9f524c5..9cefbb4db1 100644 --- a/Source/Core/Core/HW/GCPad.cpp +++ b/Source/Core/Core/HW/GCPad.cpp @@ -34,7 +34,7 @@ void Initialize() s_config.CreateController(i); } - g_controller_interface.RegisterHotplugCallback(LoadConfig); + g_controller_interface.RegisterDevicesChangedCallback(LoadConfig); // Load the saved controller config s_config.LoadConfig(true); diff --git a/Source/Core/Core/HW/Wiimote.cpp b/Source/Core/Core/HW/Wiimote.cpp index 0e0d3f9f78..178ee75540 100644 --- a/Source/Core/Core/HW/Wiimote.cpp +++ b/Source/Core/Core/HW/Wiimote.cpp @@ -80,7 +80,7 @@ void Initialize(InitializeMode init_mode) s_config.CreateController(i); } - g_controller_interface.RegisterHotplugCallback(LoadConfig); + g_controller_interface.RegisterDevicesChangedCallback(LoadConfig); LoadConfig(); diff --git a/Source/Core/Core/HotkeyManager.cpp b/Source/Core/Core/HotkeyManager.cpp index ed586e1c7c..b4574de51a 100644 --- a/Source/Core/Core/HotkeyManager.cpp +++ b/Source/Core/Core/HotkeyManager.cpp @@ -213,7 +213,7 @@ void Initialize() if (s_config.ControllersNeedToBeCreated()) s_config.CreateController(); - g_controller_interface.RegisterHotplugCallback(LoadConfig); + g_controller_interface.RegisterDevicesChangedCallback(LoadConfig); // load the saved controller config s_config.LoadConfig(true); diff --git a/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp b/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp index 4f35c4a989..1552cd7dc2 100644 --- a/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp +++ b/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp @@ -188,7 +188,7 @@ void ControllerInterface::AddDevice(std::shared_ptr device NOTICE_LOG(SERIALINTERFACE, "Added device: %s", device->GetQualifiedName().c_str()); m_devices.emplace_back(std::move(device)); } - InvokeHotplugCallbacks(); + InvokeDevicesChangedCallbacks(); } void ControllerInterface::RemoveDevice(std::function callback) @@ -205,7 +205,7 @@ void ControllerInterface::RemoveDevice(std::function callback) +void ControllerInterface::RegisterDevicesChangedCallback(std::function callback) { - m_hotplug_callbacks.emplace_back(std::move(callback)); + m_devices_changed_callbacks.emplace_back(std::move(callback)); } // -// InvokeHotplugCallbacks +// InvokeDevicesChangedCallbacks // // Invoke all callbacks that were registered // -void ControllerInterface::InvokeHotplugCallbacks() const +void ControllerInterface::InvokeDevicesChangedCallbacks() const { - for (const auto& callback : m_hotplug_callbacks) + for (const auto& callback : m_devices_changed_callbacks) callback(); } diff --git a/Source/Core/InputCommon/ControllerInterface/ControllerInterface.h b/Source/Core/InputCommon/ControllerInterface/ControllerInterface.h index eb94a8de67..e70c135b3e 100644 --- a/Source/Core/InputCommon/ControllerInterface/ControllerInterface.h +++ b/Source/Core/InputCommon/ControllerInterface/ControllerInterface.h @@ -53,12 +53,11 @@ public: bool IsInit() const { return m_is_init; } void UpdateInput(); - void RegisterHotplugCallback(std::function callback); + void RegisterDevicesChangedCallback(std::function callback); + void InvokeDevicesChangedCallbacks() const; private: - void InvokeHotplugCallbacks() const; - - std::vector> m_hotplug_callbacks; + std::vector> m_devices_changed_callbacks; bool m_is_init; void* m_hwnd; };