Commit 1e6258d2 authored by Tim Clem's avatar Tim Clem Committed by Alexandre Julliard

dinput: Create object_properties for each mouse axis.

parent b452ebb6
......@@ -1063,7 +1063,8 @@ static HRESULT check_property( struct dinput_device *impl, const GUID *guid, con
case (DWORD_PTR)DIPROP_DEADZONE:
case (DWORD_PTR)DIPROP_SATURATION:
case (DWORD_PTR)DIPROP_CALIBRATIONMODE:
if (!impl->object_properties) return DIERR_UNSUPPORTED;
/* not supported on the mouse or keyboard */
if (!(impl->caps.dwDevType & DIDEVTYPE_HID)) return DIERR_UNSUPPORTED;
break;
case (DWORD_PTR)DIPROP_FFLOAD:
......
......@@ -91,6 +91,17 @@ HRESULT mouse_enum_device( DWORD type, DWORD flags, DIDEVICEINSTANCEW *instance,
return DI_OK;
}
static BOOL CALLBACK init_object_properties( const DIDEVICEOBJECTINSTANCEW *instance, void *data )
{
struct mouse *impl = (struct mouse *)data;
struct object_properties *properties = impl->base.object_properties + instance->dwOfs / sizeof(LONG);
properties->range_min = DIPROPRANGE_NOMIN;
properties->range_max = DIPROPRANGE_NOMAX;
return DIENUM_CONTINUE;
}
HRESULT mouse_create_device( struct dinput *dinput, const GUID *guid, IDirectInputDevice8W **out )
{
struct mouse *impl;
......@@ -112,6 +123,15 @@ HRESULT mouse_create_device( struct dinput *dinput, const GUID *guid, IDirectInp
impl->base.caps.dwHardwareRevision = 100;
impl->base.dwCoopLevel = DISCL_NONEXCLUSIVE | DISCL_BACKGROUND;
/* One object_properties per axis */
impl->base.object_properties = calloc( 3, sizeof(struct object_properties) );
if (!impl->base.object_properties)
{
IDirectInputDevice_Release( &impl->base.IDirectInputDevice8W_iface );
return E_OUTOFMEMORY;
}
IDirectInputDevice8_EnumObjects( &impl->base.IDirectInputDevice8W_iface, init_object_properties, impl, DIDFT_RELAXIS );
get_app_key(&hkey, &appkey);
if (!get_config_key( hkey, appkey, L"MouseWarpOverride", buffer, sizeof(buffer) ))
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment