diff --git a/panda/src/device/winInputDeviceManager.cxx b/panda/src/device/winInputDeviceManager.cxx index 40820f40cc..515dc376d8 100644 --- a/panda/src/device/winInputDeviceManager.cxx +++ b/panda/src/device/winInputDeviceManager.cxx @@ -391,6 +391,19 @@ on_input_device_removal(HANDLE handle) { } } +/** + * Polls the system to see if there are any new devices. In some + * implementations this is a no-op. + */ +void WinInputDeviceManager:: +update() { + MSG msg; + while (PeekMessage(&msg, _message_hwnd, WM_INPUT_DEVICE_CHANGE, WM_INPUT, PM_REMOVE)) { + TranslateMessage(&msg); + DispatchMessage(&msg); + } +} + /** * Implementation of the message loop. */ diff --git a/panda/src/device/winInputDeviceManager.h b/panda/src/device/winInputDeviceManager.h index 4bf178b376..e99a01f761 100644 --- a/panda/src/device/winInputDeviceManager.h +++ b/panda/src/device/winInputDeviceManager.h @@ -52,6 +52,8 @@ private: pmap _raw_devices; pmap _raw_devices_by_path; + virtual void update() override; + static LRESULT WINAPI window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam); typedef CONFIGRET (WINAPI *pCM_Get_DevNode_Property)(DEVINST, const DEVPROPKEY *, DEVPROPTYPE *, PBYTE, PULONG, ULONG);