dinput: Implement GetProperty for JOYSTICKID (Linux driver).
This commit is contained in:
parent
29cac72d1a
commit
fbfdc6db65
|
@ -541,6 +541,42 @@ static HRESULT WINAPI JoystickLinuxAImpl_Acquire(LPDIRECTINPUTDEVICE8A iface)
|
|||
return JoystickLinuxWImpl_Acquire(IDirectInputDevice8W_from_impl(This));
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* GetProperty : get input device properties
|
||||
*/
|
||||
static HRESULT WINAPI JoystickLinuxWImpl_GetProperty(LPDIRECTINPUTDEVICE8W iface, REFGUID rguid, LPDIPROPHEADER pdiph)
|
||||
{
|
||||
JoystickImpl *This = impl_from_IDirectInputDevice8W(iface);
|
||||
|
||||
TRACE("(this=%p,%s,%p)\n", iface, debugstr_guid(rguid), pdiph);
|
||||
_dump_DIPROPHEADER(pdiph);
|
||||
|
||||
if (!IS_DIPROP(rguid)) return DI_OK;
|
||||
|
||||
switch (LOWORD(rguid)) {
|
||||
|
||||
case (DWORD_PTR) DIPROP_JOYSTICKID:
|
||||
{
|
||||
LPDIPROPDWORD pd = (LPDIPROPDWORD)pdiph;
|
||||
|
||||
pd->dwData = get_joystick_index(&This->generic.base.guid);
|
||||
TRACE("DIPROP_JOYSTICKID(%d)\n", pd->dwData);
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
return JoystickWGenericImpl_GetProperty(iface, rguid, pdiph);
|
||||
}
|
||||
|
||||
return DI_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI JoystickLinuxAImpl_GetProperty(LPDIRECTINPUTDEVICE8A iface, REFGUID rguid, LPDIPROPHEADER pdiph)
|
||||
{
|
||||
JoystickImpl *This = impl_from_IDirectInputDevice8A(iface);
|
||||
return JoystickLinuxWImpl_GetProperty(IDirectInputDevice8W_from_impl(This), rguid, pdiph);
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* Unacquire : frees the joystick
|
||||
*/
|
||||
|
@ -655,7 +691,7 @@ static const IDirectInputDevice8AVtbl JoystickAvt =
|
|||
IDirectInputDevice2AImpl_Release,
|
||||
JoystickAGenericImpl_GetCapabilities,
|
||||
IDirectInputDevice2AImpl_EnumObjects,
|
||||
JoystickAGenericImpl_GetProperty,
|
||||
JoystickLinuxAImpl_GetProperty,
|
||||
JoystickAGenericImpl_SetProperty,
|
||||
JoystickLinuxAImpl_Acquire,
|
||||
JoystickLinuxAImpl_Unacquire,
|
||||
|
@ -691,7 +727,7 @@ static const IDirectInputDevice8WVtbl JoystickWvt =
|
|||
IDirectInputDevice2WImpl_Release,
|
||||
JoystickWGenericImpl_GetCapabilities,
|
||||
IDirectInputDevice2WImpl_EnumObjects,
|
||||
JoystickWGenericImpl_GetProperty,
|
||||
JoystickLinuxWImpl_GetProperty,
|
||||
JoystickWGenericImpl_SetProperty,
|
||||
JoystickLinuxWImpl_Acquire,
|
||||
JoystickLinuxWImpl_Unacquire,
|
||||
|
|
|
@ -905,6 +905,7 @@ typedef const DIPROPSTRING *LPCDIPROPSTRING;
|
|||
|
||||
#define DIPROP_CALIBRATION MAKEDIPROP(11)
|
||||
#define DIPROP_GUIDANDPATH MAKEDIPROP(12)
|
||||
#define DIPROP_JOYSTICKID MAKEDIPROP(15)
|
||||
#define DIPROP_KEYNAME MAKEDIPROP(20)
|
||||
#define DIPROP_VIDPID MAKEDIPROP(24)
|
||||
|
||||
|
|
Loading…
Reference in New Issue