avoid dinput reinitialization on unrelated WM_DEVICECHANGE events

This commit is contained in:
radius 2017-12-26 20:14:41 -05:00
parent fee7ab9dc8
commit ab54fda509
2 changed files with 10 additions and 4 deletions

View File

@ -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.

View File

@ -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)