mirror of https://github.com/snes9xgit/snes9x.git
win32: disable hotplugging, add menu entry to detect gamepad changes
This commit is contained in:
parent
5593fb762a
commit
4733942460
|
@ -486,6 +486,7 @@
|
||||||
#define ID_EMULATION_BACKGROUNDINPUT 40174
|
#define ID_EMULATION_BACKGROUNDINPUT 40174
|
||||||
#define ID_SAVEMEMPACK 40175
|
#define ID_SAVEMEMPACK 40175
|
||||||
#define ID_INPUT_BACKGROUNDKEYBOARDHOTKEYS 40176
|
#define ID_INPUT_BACKGROUNDKEYBOARDHOTKEYS 40176
|
||||||
|
#define ID_INPUT_DETECTGAMEPADCHANGES 40177
|
||||||
#define ID_FILE_SAVE0 44000
|
#define ID_FILE_SAVE0 44000
|
||||||
#define ID_FILE_SAVE1 44001
|
#define ID_FILE_SAVE1 44001
|
||||||
#define ID_FILE_SAVE2 44002
|
#define ID_FILE_SAVE2 44002
|
||||||
|
|
|
@ -882,6 +882,8 @@ BEGIN
|
||||||
MENUITEM "Enable Background Input", ID_EMULATION_BACKGROUNDINPUT
|
MENUITEM "Enable Background Input", ID_EMULATION_BACKGROUNDINPUT
|
||||||
MENUITEM "Background Keyboard Hotkeys", ID_INPUT_BACKGROUNDKEYBOARDHOTKEYS
|
MENUITEM "Background Keyboard Hotkeys", ID_INPUT_BACKGROUNDKEYBOARDHOTKEYS
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
|
MENUITEM "Detect gamepad changes", ID_INPUT_DETECTGAMEPADCHANGES
|
||||||
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "Use SNES Joypad(s)", IDM_SNES_JOYPAD
|
MENUITEM "Use SNES Joypad(s)", IDM_SNES_JOYPAD
|
||||||
MENUITEM "Use SNES Mouse", IDM_MOUSE_TOGGLE
|
MENUITEM "Use SNES Mouse", IDM_MOUSE_TOGGLE
|
||||||
MENUITEM "Use Super Scope", IDM_SCOPE_TOGGLE
|
MENUITEM "Use Super Scope", IDM_SCOPE_TOGGLE
|
||||||
|
|
|
@ -1944,6 +1944,10 @@ LRESULT CALLBACK WinProc(
|
||||||
GUI.BackgroundKeyHotkeys = !GUI.BackgroundKeyHotkeys;
|
GUI.BackgroundKeyHotkeys = !GUI.BackgroundKeyHotkeys;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case ID_INPUT_DETECTGAMEPADCHANGES:
|
||||||
|
S9xDetectJoypads();
|
||||||
|
break;
|
||||||
|
|
||||||
case ID_FILE_LOADMULTICART:
|
case ID_FILE_LOADMULTICART:
|
||||||
{
|
{
|
||||||
RestoreGUIDisplay ();
|
RestoreGUIDisplay ();
|
||||||
|
@ -2717,20 +2721,6 @@ LRESULT CALLBACK WinProc(
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
case WM_DEVICECHANGE:
|
|
||||||
if (wParam == DBT_DEVICEARRIVAL || wParam == DBT_DEVICEREMOVECOMPLETE) {
|
|
||||||
// trigger a joypad detect after 500ms - the multimedia functions do not like it if we trigger this right after arrival/removal
|
|
||||||
SetTimer(hWnd, TIMER_SCANJOYPADS, 500, NULL);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case WM_TIMER:
|
|
||||||
{
|
|
||||||
if (wParam == TIMER_SCANJOYPADS) {
|
|
||||||
S9xDetectJoypads();
|
|
||||||
KillTimer(hWnd, TIMER_SCANJOYPADS);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
return DefWindowProc (hWnd, uMsg, wParam, lParam);
|
return DefWindowProc (hWnd, uMsg, wParam, lParam);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue