mirror of https://github.com/encounter/SDL.git
Fixed bug 2069 - Device addition/removal queries all USB devices rather than only HID devices.
Andreas Ertelt SDL_dxjoystick.c is setting the classguid for device (dis)connect events to USB Devices in general: dbh.dbcc_classguid = GUID_DEVINTERFACE_USB_DEVICE; Wouldn't it make more sense to have it just subscribe to Hid device events? This would mean less meaningless events reaching the application.
This commit is contained in:
parent
3f8df1097c
commit
7ad441a37c
|
@ -53,6 +53,8 @@
|
||||||
#define DIDFT_OPTIONAL 0x80000000
|
#define DIDFT_OPTIONAL 0x80000000
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
DEFINE_GUID(GUID_DEVINTERFACE_HID, 0x4D1E55B2L, 0xF16F, 0x11CF, 0x88, 0xCB, 0x00, 0x11, 0x11, 0x00, 0x00, 0x30);
|
||||||
|
|
||||||
|
|
||||||
#define INPUT_QSIZE 32 /* Buffer up to 32 input messages */
|
#define INPUT_QSIZE 32 /* Buffer up to 32 input messages */
|
||||||
#define AXIS_MIN -32768 /* minimum value for axis coordinate */
|
#define AXIS_MIN -32768 /* minimum value for axis coordinate */
|
||||||
|
@ -387,7 +389,6 @@ SDL_IsXInputDevice( const GUID* pGuidProductFromDirectInput )
|
||||||
};
|
};
|
||||||
|
|
||||||
size_t iDevice;
|
size_t iDevice;
|
||||||
SDL_bool retval = SDL_FALSE;
|
|
||||||
UINT i;
|
UINT i;
|
||||||
|
|
||||||
if (!s_bXInputEnabled) {
|
if (!s_bXInputEnabled) {
|
||||||
|
@ -507,7 +508,7 @@ SDL_JoystickThread(void *_data)
|
||||||
|
|
||||||
dbh.dbcc_size = sizeof(dbh);
|
dbh.dbcc_size = sizeof(dbh);
|
||||||
dbh.dbcc_devicetype = DBT_DEVTYP_DEVICEINTERFACE;
|
dbh.dbcc_devicetype = DBT_DEVTYP_DEVICEINTERFACE;
|
||||||
dbh.dbcc_classguid = GUID_DEVINTERFACE_USB_DEVICE;
|
dbh.dbcc_classguid = GUID_DEVINTERFACE_HID;
|
||||||
|
|
||||||
hNotify = RegisterDeviceNotification( messageWindow, &dbh, DEVICE_NOTIFY_WINDOW_HANDLE );
|
hNotify = RegisterDeviceNotification( messageWindow, &dbh, DEVICE_NOTIFY_WINDOW_HANDLE );
|
||||||
if ( !hNotify )
|
if ( !hNotify )
|
||||||
|
|
|
@ -42,7 +42,7 @@
|
||||||
#include <xinput.h>
|
#include <xinput.h>
|
||||||
#include <devguid.h>
|
#include <devguid.h>
|
||||||
#include <dbt.h>
|
#include <dbt.h>
|
||||||
#include <xinput.h>
|
|
||||||
|
|
||||||
#ifndef XUSER_MAX_COUNT
|
#ifndef XUSER_MAX_COUNT
|
||||||
#define XUSER_MAX_COUNT 4
|
#define XUSER_MAX_COUNT 4
|
||||||
|
|
Loading…
Reference in New Issue