diff --git a/CHANGES.md b/CHANGES.md index 6c044b23e2..34d85d90fe 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,6 @@ # 1.7.1 (future) -- COMMON: Fix menu toggle with keymapper active. +- DINPUT: don't reinitialize input driver on network events / media insertion / network drive connection +- KEYMAPPER: prevent a condition that caused input_menu_toggle to stop working when a RETRO_DEVICE_KEYBOARD type device is enabled - PS3: Enable Cheevos. - PSP: Enable threading support through pthreads. diff --git a/input/drivers/dinput.c b/input/drivers/dinput.c index 26757500f3..95947e6366 100644 --- a/input/drivers/dinput.c +++ b/input/drivers/dinput.c @@ -21,6 +21,8 @@ #undef DIRECTINPUT_VERSION #define DIRECTINPUT_VERSION 0x0800 +#define DBT_DEVNODES_CHANGED 0x0007 + #ifndef WM_MOUSEHWHEEL #define WM_MOUSEHWHEEL 0x20e #endif @@ -802,9 +804,12 @@ bool dinput_handle_message(void *dinput, UINT message, WPARAM wParam, LPARAM lPa return true; } case WM_DEVICECHANGE: - if (di->joypad) - di->joypad->destroy(); - di->joypad = input_joypad_init_driver(di->joypad_driver_name, di); + if (wParam == DBT_DEVNODES_CHANGED) + { + if (di->joypad) + di->joypad->destroy(); + di->joypad = input_joypad_init_driver(di->joypad_driver_name, di); + } break; case WM_MOUSEWHEEL: if (((short) HIWORD(wParam))/120 > 0)