Detect when a joypad is added or removed while bizhawk is open fixes #698

This commit is contained in:
adelikat 2016-09-21 21:23:57 -04:00
parent c5025e9992
commit 10a2ae1471
1 changed files with 10 additions and 0 deletions

View File

@ -2595,9 +2595,19 @@ namespace BizHawk.Client.EmuHawk
});
}
private const int WM_DEVICECHANGE = 0x0219;
// Alt key hacks
protected override void WndProc(ref Message m)
{
switch (m.Msg)
{
case WM_DEVICECHANGE:
GamePad.Initialize();
GamePad360.Initialize();
break;
}
// this is necessary to trap plain alt keypresses so that only our hotkey system gets them
if (m.Msg == 0x0112) // WM_SYSCOMMAND
{