Add initial XInput support

This commit is contained in:
Camilla Berglund
2014-08-15 15:08:09 +02:00
parent 9f1474c1d0
commit eb3577c1eb
5 changed files with 323 additions and 121 deletions
+26 -3
View File
@@ -376,10 +376,33 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg,
switch (uMsg)
{
case WM_DISPLAYCHANGE:
case WM_DEVICECHANGE:
{
_glfwInputMonitorChange();
return 0;
if (wParam == DBT_DEVNODES_CHANGED)
{
_glfwInputMonitorChange();
return TRUE;
}
else if (wParam == DBT_DEVICEARRIVAL)
{
DEV_BROADCAST_HDR* dbh = (DEV_BROADCAST_HDR*) lParam;
if (dbh)
{
if (dbh->dbch_devicetype == DBT_DEVTYP_DEVICEINTERFACE)
_glfwDetectJoystickConnectionWin32();
}
}
else if (wParam == DBT_DEVICEREMOVECOMPLETE)
{
DEV_BROADCAST_HDR* dbh = (DEV_BROADCAST_HDR*) lParam;
if (dbh)
{
if (dbh->dbch_devicetype == DBT_DEVTYP_DEVICEINTERFACE)
_glfwDetectJoystickDisconnectionWin32();
}
}
break;
}
}