ControllerInterface: invoke callbacks in AddDevice/RemoveDevice

Some backends already cause this to happen, so make it consistent across
systems.
This commit is contained in:
Michael M
2017-11-09 12:14:21 -08:00
parent 126b7ea01c
commit 7355b5f70d
6 changed files with 47 additions and 30 deletions

View File

@ -156,8 +156,6 @@ static void DeviceRemovalCallback(void* inContext, IOReturn inResult, void* inSe
return false;
});
g_controller_interface.InvokeHotplugCallbacks();
NOTICE_LOG(SERIALINTERFACE, "Removed device: %s", GetDeviceRefName(inIOHIDDeviceRef).c_str());
}
static void DeviceMatchingCallback(void* inContext, IOReturn inResult, void* inSender,
@ -174,9 +172,6 @@ static void DeviceMatchingCallback(void* inContext, IOReturn inResult, void* inS
{
g_controller_interface.AddDevice(std::make_shared<Joystick>(inIOHIDDeviceRef, name));
}
NOTICE_LOG(SERIALINTERFACE, "Added device: %s", name.c_str());
g_controller_interface.InvokeHotplugCallbacks();
}
void Init(void* window)