dinput: Assign button GUID to joystick buttons.
authorVitaliy Margolen <wine-patches@kievinfo.com>
Sat, 12 Apr 2008 17:33:04 +0000 (11:33 -0600)
committerAlexandre Julliard <julliard@winehq.org>
Mon, 14 Apr 2008 10:40:22 +0000 (12:40 +0200)
dlls/dinput/joystick_linux.c
dlls/dinput/joystick_linuxinput.c

index a43f842c658fc206c1429432d01565ea9e192143..e9b879021bf66e4c116a58738bebd37883e2d2b8 100644 (file)
@@ -471,6 +471,7 @@ static HRESULT alloc_device(REFGUID rguid, const void *jvt, IDirectInputImpl *di
     for (i = 0; i < newDevice->buttons; i++)
     {
         memcpy(&df->rgodf[idx], &c_dfDIJoystick2.rgodf[i + 12], df->dwObjSize);
+        df->rgodf[idx  ].pguid = &GUID_Button;
         df->rgodf[idx++].dwType = DIDFT_MAKEINSTANCE(i) | DIDFT_PSHBUTTON;
     }
     newDevice->base.data_format.wine_df = df;
index c31fc2898d70e584ee498712e52ecf863db71536..76456b07c372cf70116bb393d408eac7641171e0 100644 (file)
@@ -373,7 +373,7 @@ static BOOL joydev_enum_deviceA(DWORD dwDevType, DWORD dwFlags, LPDIDEVICEINSTAN
   if (id >= have_joydevs) {
     return FALSE;
   }
+
   if (!((dwDevType == 0) ||
         ((dwDevType == DIDEVTYPE_JOYSTICK) && (version < 0x0800)) ||
         (((dwDevType == DI8DEVCLASS_GAMECTRL) || (dwDevType == DI8DEVTYPE_JOYSTICK)) && (version >= 0x0800))))
@@ -498,6 +498,7 @@ static JoystickImpl *alloc_device(REFGUID rguid, const void *jvt, IDirectInputIm
 
         memcpy(&df->rgodf[idx], &c_dfDIJoystick2.rgodf[newDevice->numButtons + WINE_JOYSTICK_MAX_AXES + WINE_JOYSTICK_MAX_POVS], df->dwObjSize);
        newDevice->buttons[i] = 0x80 | newDevice->numButtons;
+        df->rgodf[idx  ].pguid = &GUID_Button;
         df->rgodf[idx++].dwType = DIDFT_MAKEINSTANCE(newDevice->numButtons++) | DIDFT_PSHBUTTON;
     }
     df->dwNumObjs = idx;