Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/dinput/joystick_hid.c | 7 ++++--- dlls/dinput8/tests/hid.c | 3 --- 2 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/dlls/dinput/joystick_hid.c b/dlls/dinput/joystick_hid.c index dfff379091e..73339564cd1 100644 --- a/dlls/dinput/joystick_hid.c +++ b/dlls/dinput/joystick_hid.c @@ -515,7 +515,7 @@ static BOOL get_property_prop_range( struct hid_joystick *impl, struct hid_caps DIPROPRANGE *value = data; value->lMin = value_caps->PhysicalMin; value->lMax = value_caps->PhysicalMax; - return DIENUM_CONTINUE; + return DIENUM_STOP; }
static HRESULT WINAPI hid_joystick_GetProperty( IDirectInputDevice8W *iface, const GUID *guid, @@ -533,8 +533,9 @@ static HRESULT WINAPI hid_joystick_GetProperty( IDirectInputDevice8W *iface, con { case (DWORD_PTR)DIPROP_RANGE: if (header->dwSize != sizeof(DIPROPRANGE)) return DIERR_INVALIDPARAM; - enum_objects( impl, header, DIDFT_AXIS, get_property_prop_range, header ); - return DI_OK; + if (enum_objects( impl, header, DIDFT_AXIS, get_property_prop_range, header ) == DIENUM_STOP) + return DI_OK; + return DIERR_NOTFOUND; case (DWORD_PTR)DIPROP_PRODUCTNAME: { DIPROPSTRING *value = (DIPROPSTRING *)header; diff --git a/dlls/dinput8/tests/hid.c b/dlls/dinput8/tests/hid.c index 25e7511353f..affdddd153f 100644 --- a/dlls/dinput8/tests/hid.c +++ b/dlls/dinput8/tests/hid.c @@ -3908,15 +3908,12 @@ static void test_simple_joystick(void) prop_range.lMin = 0xdeadbeef; prop_range.lMax = 0xdeadbeef; hr = IDirectInputDevice8_GetProperty( device, DIPROP_RANGE, &prop_range.diph ); - todo_wine ok( hr == DIERR_NOTFOUND, "IDirectInputDevice8_GetProperty DIPROP_RANGE returned %#x\n", hr ); prop_range.diph.dwObj = MAKELONG( 0, HID_USAGE_PAGE_GENERIC ); hr = IDirectInputDevice8_GetProperty( device, DIPROP_RANGE, &prop_range.diph ); - todo_wine ok( hr == DIERR_NOTFOUND, "IDirectInputDevice8_GetProperty DIPROP_RANGE returned %#x\n", hr ); prop_range.diph.dwObj = MAKELONG( HID_USAGE_PAGE_GENERIC, HID_USAGE_GENERIC_X ); hr = IDirectInputDevice8_GetProperty( device, DIPROP_RANGE, &prop_range.diph ); - todo_wine ok( hr == DIERR_NOTFOUND, "IDirectInputDevice8_GetProperty DIPROP_RANGE returned %#x\n", hr ); prop_range.diph.dwObj = MAKELONG( HID_USAGE_GENERIC_X, HID_USAGE_PAGE_GENERIC ); prop_range.lMin = 0xdeadbeef;
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/dinput/joystick_hid.c | 1 + dlls/dinput8/tests/hid.c | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-)
diff --git a/dlls/dinput/joystick_hid.c b/dlls/dinput/joystick_hid.c index 73339564cd1..b4ccbd9f509 100644 --- a/dlls/dinput/joystick_hid.c +++ b/dlls/dinput/joystick_hid.c @@ -533,6 +533,7 @@ static HRESULT WINAPI hid_joystick_GetProperty( IDirectInputDevice8W *iface, con { case (DWORD_PTR)DIPROP_RANGE: if (header->dwSize != sizeof(DIPROPRANGE)) return DIERR_INVALIDPARAM; + if (header->dwHow == DIPH_DEVICE) return DIERR_UNSUPPORTED; if (enum_objects( impl, header, DIDFT_AXIS, get_property_prop_range, header ) == DIENUM_STOP) return DI_OK; return DIERR_NOTFOUND; diff --git a/dlls/dinput8/tests/hid.c b/dlls/dinput8/tests/hid.c index affdddd153f..41f6d5316b5 100644 --- a/dlls/dinput8/tests/hid.c +++ b/dlls/dinput8/tests/hid.c @@ -3879,7 +3879,6 @@ static void test_simple_joystick(void) todo_wine ok( hr == DIERR_UNSUPPORTED, "IDirectInputDevice8_GetProperty DIPROP_SATURATION returned %#x\n", hr ); hr = IDirectInputDevice8_GetProperty( device, DIPROP_RANGE, &prop_range.diph ); - todo_wine ok( hr == DIERR_UNSUPPORTED, "IDirectInputDevice8_GetProperty DIPROP_RANGE returned %#x\n", hr );
prop_dword.diph.dwHow = DIPH_BYUSAGE; @@ -4288,7 +4287,6 @@ static void test_simple_joystick(void) prop_range.lMin = 0xdeadbeef; prop_range.lMax = 0xdeadbeef; hr = IDirectInputDevice8_GetProperty( device, DIPROP_RANGE, &prop_range.diph ); - todo_wine ok( hr == DIERR_UNSUPPORTED, "IDirectInputDevice8_GetProperty DIPROP_RANGE returned %#x\n", hr ); prop_range.diph.dwHow = DIPH_BYUSAGE; prop_range.diph.dwObj = MAKELONG( HID_USAGE_GENERIC_X, HID_USAGE_PAGE_GENERIC );
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/dinput/joystick_hid.c | 4 ++++ dlls/dinput8/tests/hid.c | 1 - 2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/dlls/dinput/joystick_hid.c b/dlls/dinput/joystick_hid.c index b4ccbd9f509..6d70e188dbe 100644 --- a/dlls/dinput/joystick_hid.c +++ b/dlls/dinput/joystick_hid.c @@ -607,9 +607,13 @@ static HRESULT WINAPI hid_joystick_SetProperty( IDirectInputDevice8W *iface, con switch (LOWORD( guid )) { case (DWORD_PTR)DIPROP_RANGE: + { + DIPROPRANGE *value = (DIPROPRANGE *)header; if (header->dwSize != sizeof(DIPROPRANGE)) return DIERR_INVALIDPARAM; + if (value->lMin > value->lMax) return DIERR_INVALIDPARAM; enum_objects( impl, header, DIDFT_AXIS, set_property_prop_range, (void *)header ); return DI_OK; + } case (DWORD_PTR)DIPROP_FFLOAD: case (DWORD_PTR)DIPROP_GRANULARITY: case (DWORD_PTR)DIPROP_VIDPID: diff --git a/dlls/dinput8/tests/hid.c b/dlls/dinput8/tests/hid.c index 41f6d5316b5..0270467dea8 100644 --- a/dlls/dinput8/tests/hid.c +++ b/dlls/dinput8/tests/hid.c @@ -4275,7 +4275,6 @@ static void test_simple_joystick(void) prop_range.lMin = -4000; prop_range.lMax = -14000; hr = IDirectInputDevice8_SetProperty( device, DIPROP_RANGE, &prop_range.diph ); - todo_wine ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_SetProperty DIPROP_RANGE returned %#x\n", hr ); prop_range.lMin = -14000; prop_range.lMax = -4000;
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/dinput/joystick_hid.c | 19 ++++++++++++++++--- dlls/dinput8/tests/hid.c | 16 ++++++---------- 2 files changed, 22 insertions(+), 13 deletions(-)
diff --git a/dlls/dinput/joystick_hid.c b/dlls/dinput/joystick_hid.c index 6d70e188dbe..e20d02224fe 100644 --- a/dlls/dinput/joystick_hid.c +++ b/dlls/dinput/joystick_hid.c @@ -20,6 +20,7 @@ #include <assert.h> #include <stdarg.h> #include <string.h> +#include <math.h>
#include "windef.h" #include "winbase.h" @@ -585,11 +586,23 @@ static BOOL set_property_prop_range( struct hid_joystick *impl, struct hid_caps { HIDP_VALUE_CAPS *value_caps = caps->value; DIPROPRANGE *value = data; - LONG range = value_caps->LogicalMax - value_caps->LogicalMin; + LONG tmp; + value_caps->PhysicalMin = value->lMin; value_caps->PhysicalMax = value->lMax; - if (instance->dwType & DIDFT_POV && range > 0) - value_caps->PhysicalMax -= value->lMax / (range + 1); + + if (instance->dwType & DIDFT_AXIS) + { + if (!value_caps->PhysicalMin) tmp = value_caps->PhysicalMax / 2; + else tmp = round( (value_caps->PhysicalMin + value_caps->PhysicalMax) / 2.0 ); + *(LONG *)(impl->device_state + instance->dwOfs) = tmp; + } + else if (instance->dwType & DIDFT_POV) + { + tmp = value_caps->LogicalMax - value_caps->LogicalMin; + if (tmp > 0) value_caps->PhysicalMax -= value->lMax / (tmp + 1); + *(LONG *)(impl->device_state + instance->dwOfs) = -1; + } return DIENUM_CONTINUE; }
diff --git a/dlls/dinput8/tests/hid.c b/dlls/dinput8/tests/hid.c index 0270467dea8..ae758837d36 100644 --- a/dlls/dinput8/tests/hid.c +++ b/dlls/dinput8/tests/hid.c @@ -4098,14 +4098,13 @@ static void test_simple_joystick(void) winetest_push_context( "state[%d]", i ); hr = IDirectInputDevice8_GetDeviceState( device, sizeof(DIJOYSTATE2), &state ); ok( hr == DI_OK, "IDirectInputDevice8_GetDeviceState returned: %#x\n", hr ); - todo_wine_if( i != 2 ) + todo_wine_if( i != 0 && i != 2 ) check_member( state, expect_state[i], "%d", lX ); - todo_wine_if( i != 2 ) + todo_wine_if( i != 0 && i != 2 ) check_member( state, expect_state[i], "%d", lY ); - todo_wine + todo_wine_if( i != 0 ) check_member( state, expect_state[i], "%d", lZ ); check_member( state, expect_state[i], "%d", lRx ); - todo_wine_if( i == 0 ) check_member( state, expect_state[i], "%#x", rgdwPOV[0] ); check_member( state, expect_state[i], "%#x", rgdwPOV[1] ); check_member( state, expect_state[i], "%#x", rgbButtons[0] ); @@ -4306,11 +4305,8 @@ static void test_simple_joystick(void)
hr = IDirectInputDevice8_GetDeviceState( device, sizeof(DIJOYSTATE2), &state ); ok( hr == DI_OK, "IDirectInputDevice8_GetDeviceState returned: %#x\n", hr ); - todo_wine check_member( state, expect_state_abs[1], "%d", lX ); - todo_wine check_member( state, expect_state_abs[1], "%d", lY ); - todo_wine check_member( state, expect_state_abs[1], "%d", lZ ); check_member( state, expect_state_abs[1], "%d", lRx ); check_member( state, expect_state_abs[1], "%d", rgdwPOV[0] ); @@ -4452,12 +4448,12 @@ static void test_simple_joystick(void) if (broken( state.lX == -10750 )) win_skip( "Ignoring 32-bit rounding\n" ); else { - todo_wine_if( i != 2 ) + todo_wine_if( i != 0 && i != 2 ) check_member( state, expect_state_abs[i], "%d", lX ); - todo_wine_if( i != 2 ) + todo_wine_if( i != 0 && i != 2 ) check_member( state, expect_state_abs[i], "%d", lY ); } - todo_wine + todo_wine_if( i != 0 ) check_member( state, expect_state_abs[i], "%d", lZ ); check_member( state, expect_state_abs[i], "%d", lRx ); check_member( state, expect_state_abs[i], "%d", rgdwPOV[0] );
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/dinput/joystick_hid.c | 43 +++++++++++++++++++++++++++++++++----- dlls/dinput8/tests/hid.c | 30 ++++++++------------------ 2 files changed, 47 insertions(+), 26 deletions(-)
diff --git a/dlls/dinput/joystick_hid.c b/dlls/dinput/joystick_hid.c index e20d02224fe..3dc0776a1ec 100644 --- a/dlls/dinput/joystick_hid.c +++ b/dlls/dinput/joystick_hid.c @@ -854,15 +854,47 @@ static LONG sign_extend( ULONG value, const HIDP_VALUE_CAPS *caps )
static LONG scale_value( ULONG value, const HIDP_VALUE_CAPS *caps, LONG min, LONG max ) { - ULONG bit_max = (1 << caps->BitSize) - 1; LONG tmp = sign_extend( value, caps ); - - /* xinput HID gamepad have bogus logical value range, let's use the bit range instead */ - if (caps->LogicalMin == 0 && caps->LogicalMax == -1) return min + MulDiv( tmp, max - min, bit_max ); if (caps->LogicalMin > tmp || caps->LogicalMax < tmp) return -1; /* invalid / null value */ return min + MulDiv( tmp - caps->LogicalMin, max - min, caps->LogicalMax - caps->LogicalMin ); }
+static LONG scale_axis_value( ULONG value, const HIDP_VALUE_CAPS *caps ) +{ + LONG tmp = sign_extend( value, caps ), log_ctr, log_min, log_max, phy_ctr, phy_min, phy_max; + ULONG bit_max = (1 << caps->BitSize) - 1; + + log_min = caps->LogicalMin; + log_max = caps->LogicalMax; + phy_min = caps->PhysicalMin; + phy_max = caps->PhysicalMax; + /* xinput HID gamepad have bogus logical value range, let's use the bit range instead */ + if (log_min == 0 && log_max == -1) log_max = bit_max; + + if (phy_min == 0) phy_ctr = phy_max >> 1; + else phy_ctr = round( (phy_min + phy_max) / 2.0 ); + if (log_min == 0) log_ctr = log_max >> 1; + else log_ctr = round( (log_min + log_max) / 2.0 ); + + tmp -= log_ctr; + if (tmp <= 0) + { + log_max = 0; + log_min -= log_ctr; + phy_max = phy_ctr; + } + else + { + log_min = 0; + log_max -= log_ctr; + phy_min = phy_ctr; + } + + if (tmp <= log_min) return phy_min; + if (tmp >= log_max) return phy_max; + return phy_min + MulDiv( tmp - log_min, phy_max - phy_min, log_max - log_min ); +} + static BOOL read_device_state_value( struct hid_joystick *impl, struct hid_caps *caps, DIDEVICEOBJECTINSTANCEW *instance, void *data ) { @@ -878,7 +910,8 @@ static BOOL read_device_state_value( struct hid_joystick *impl, struct hid_caps &logical_value, impl->preparsed, report_buf, report_len ); if (status != HIDP_STATUS_SUCCESS) WARN( "HidP_GetUsageValue %04x:%04x returned %#x\n", instance->wUsagePage, instance->wUsage, status ); - value = scale_value( logical_value, value_caps, value_caps->PhysicalMin, value_caps->PhysicalMax ); + if (instance->dwType & DIDFT_AXIS) value = scale_axis_value( logical_value, value_caps ); + else value = scale_value( logical_value, value_caps, value_caps->PhysicalMin, value_caps->PhysicalMax );
old_value = *(LONG *)(params->old_state + instance->dwOfs); *(LONG *)(impl->device_state + instance->dwOfs) = value; diff --git a/dlls/dinput8/tests/hid.c b/dlls/dinput8/tests/hid.c index ae758837d36..ec5dffe70f5 100644 --- a/dlls/dinput8/tests/hid.c +++ b/dlls/dinput8/tests/hid.c @@ -4098,11 +4098,8 @@ static void test_simple_joystick(void) winetest_push_context( "state[%d]", i ); hr = IDirectInputDevice8_GetDeviceState( device, sizeof(DIJOYSTATE2), &state ); ok( hr == DI_OK, "IDirectInputDevice8_GetDeviceState returned: %#x\n", hr ); - todo_wine_if( i != 0 && i != 2 ) check_member( state, expect_state[i], "%d", lX ); - todo_wine_if( i != 0 && i != 2 ) check_member( state, expect_state[i], "%d", lY ); - todo_wine_if( i != 0 ) check_member( state, expect_state[i], "%d", lZ ); check_member( state, expect_state[i], "%d", lRx ); check_member( state, expect_state[i], "%#x", rgdwPOV[0] ); @@ -4114,20 +4111,17 @@ static void test_simple_joystick(void) send_hid_input( file, &injected_input[i], sizeof(*injected_input) );
res = WaitForSingleObject( event, 100 ); - if (i == 0 || i == 3) todo_wine_if( i == 0 ) - ok( res == WAIT_TIMEOUT, "WaitForSingleObject succeeded\n" ); - else ok( res == WAIT_OBJECT_0, "WaitForSingleObject failed\n" ); ResetEvent( event ); + if (i == 0 || i == 3) ok( res == WAIT_TIMEOUT, "WaitForSingleObject succeeded\n" ); + else ok( res == WAIT_OBJECT_0, "WaitForSingleObject failed\n" ); + ResetEvent( event ); winetest_pop_context(); }
hr = IDirectInputDevice8_GetDeviceState( device, sizeof(DIJOYSTATE2), &state ); ok( hr == DI_OK, "IDirectInputDevice8_GetDeviceState returned: %#x\n", hr ); winetest_push_context( "state[%d]", i ); - todo_wine check_member( state, expect_state[i], "%d", lX ); - todo_wine check_member( state, expect_state[i], "%d", lY ); - todo_wine check_member( state, expect_state[i], "%d", lZ ); check_member( state, expect_state[i], "%d", lRx ); check_member( state, expect_state[i], "%#x", rgdwPOV[0] ); @@ -4237,7 +4231,7 @@ static void test_simple_joystick(void) winetest_push_context( "objdata[%d]", i ); todo_wine check_member( objdata[i], expect_objdata[6 + i], "%#x", dwOfs ); - todo_wine_if( i != 3 && i != 4 && i != 7 ) + todo_wine_if( i == 1 || i == 2 || i == 6 ) check_member( objdata[i], expect_objdata[6 + i], "%#x", dwData ); ok( objdata[i].uAppData == -1, "got %p, expected %p\n", (void *)objdata[i].uAppData, (void *)-1 ); winetest_pop_context(); @@ -4250,11 +4244,8 @@ static void test_simple_joystick(void)
hr = IDirectInputDevice8_GetDeviceState( device, sizeof(DIJOYSTATE2), &state ); ok( hr == DI_OK, "IDirectInputDevice8_GetDeviceState returned: %#x\n", hr ); - todo_wine check_member( state, expect_state[3], "%d", lX ); - todo_wine check_member( state, expect_state[3], "%d", lY ); - todo_wine check_member( state, expect_state[3], "%d", lZ ); check_member( state, expect_state[3], "%d", lRx ); check_member( state, expect_state[3], "%d", rgdwPOV[0] ); @@ -4448,12 +4439,11 @@ static void test_simple_joystick(void) if (broken( state.lX == -10750 )) win_skip( "Ignoring 32-bit rounding\n" ); else { - todo_wine_if( i != 0 && i != 2 ) + todo_wine_if( i == 3 || i == 4 ) check_member( state, expect_state_abs[i], "%d", lX ); - todo_wine_if( i != 0 && i != 2 ) + todo_wine_if( i == 3 || i == 4 ) check_member( state, expect_state_abs[i], "%d", lY ); } - todo_wine_if( i != 0 ) check_member( state, expect_state_abs[i], "%d", lZ ); check_member( state, expect_state_abs[i], "%d", lRx ); check_member( state, expect_state_abs[i], "%d", rgdwPOV[0] ); @@ -4465,20 +4455,18 @@ static void test_simple_joystick(void) send_hid_input( file, &injected_input[i], sizeof(*injected_input) );
res = WaitForSingleObject( event, 100 ); - if (i == 0 || i == 3) todo_wine_if( i == 0 ) - ok( res == WAIT_TIMEOUT, "WaitForSingleObject succeeded\n" ); - else ok( res == WAIT_OBJECT_0, "WaitForSingleObject failed\n" ); ResetEvent( event ); + if (i == 0 || i == 3) ok( res == WAIT_TIMEOUT, "WaitForSingleObject succeeded\n" ); + else ok( res == WAIT_OBJECT_0, "WaitForSingleObject failed\n" ); + ResetEvent( event ); winetest_pop_context(); }
hr = IDirectInputDevice8_GetDeviceState( device, sizeof(DIJOYSTATE2), &state ); ok( hr == DI_OK, "IDirectInputDevice8_GetDeviceState returned: %#x\n", hr ); winetest_push_context( "state[%d]", i ); - todo_wine check_member( state, expect_state_abs[i], "%d", lX ); todo_wine check_member( state, expect_state_abs[i], "%d", lY ); - todo_wine check_member( state, expect_state_abs[i], "%d", lZ ); check_member( state, expect_state_abs[i], "%d", lRx ); check_member( state, expect_state_abs[i], "%d", rgdwPOV[0] );
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/dinput/joystick_hid.c | 119 +++++++++++++++++++++++++++++++++++-- dlls/dinput8/tests/hid.c | 30 ---------- 2 files changed, 113 insertions(+), 36 deletions(-)
diff --git a/dlls/dinput/joystick_hid.c b/dlls/dinput/joystick_hid.c index 3dc0776a1ec..4ce60e67faf 100644 --- a/dlls/dinput/joystick_hid.c +++ b/dlls/dinput/joystick_hid.c @@ -137,6 +137,12 @@ static inline const char *debugstr_hid_caps( struct hid_caps *caps ) return "(unknown type)"; }
+struct extra_caps +{ + LONG deadzone; + LONG saturation; +}; + #define DEVICE_STATE_MAX_SIZE 1024
struct hid_joystick @@ -156,6 +162,7 @@ struct hid_joystick HIDP_LINK_COLLECTION_NODE *collection_nodes; HIDP_BUTTON_CAPS *input_button_caps; HIDP_VALUE_CAPS *input_value_caps; + struct extra_caps *input_extra_caps;
char *input_report_buf; USAGE_AND_PAGE *usages_buf; @@ -424,6 +431,7 @@ static ULONG WINAPI hid_joystick_Release( IDirectInputDevice8W *iface ) { HeapFree( GetProcessHeap(), 0, tmp.usages_buf ); HeapFree( GetProcessHeap(), 0, tmp.input_report_buf ); + HeapFree( GetProcessHeap(), 0, tmp.input_extra_caps ); HeapFree( GetProcessHeap(), 0, tmp.input_value_caps ); HeapFree( GetProcessHeap(), 0, tmp.input_button_caps ); HeapFree( GetProcessHeap(), 0, tmp.collection_nodes ); @@ -519,6 +527,34 @@ static BOOL get_property_prop_range( struct hid_joystick *impl, struct hid_caps return DIENUM_STOP; }
+static BOOL get_property_prop_deadzone( struct hid_joystick *impl, struct hid_caps *caps, + DIDEVICEOBJECTINSTANCEW *instance, void *data ) +{ + struct extra_caps *extra; + DIPROPDWORD *deadzone = data; + extra = impl->input_extra_caps + (caps->value - impl->input_value_caps); + deadzone->dwData = extra->deadzone; + return DIENUM_STOP; +} + +static BOOL get_property_prop_saturation( struct hid_joystick *impl, struct hid_caps *caps, + DIDEVICEOBJECTINSTANCEW *instance, void *data ) +{ + struct extra_caps *extra; + DIPROPDWORD *saturation = data; + extra = impl->input_extra_caps + (caps->value - impl->input_value_caps); + saturation->dwData = extra->saturation; + return DIENUM_STOP; +} + +static BOOL get_property_prop_granularity( struct hid_joystick *impl, struct hid_caps *caps, + DIDEVICEOBJECTINSTANCEW *instance, void *data ) +{ + DIPROPDWORD *granularity = data; + granularity->dwData = 1; + return DIENUM_STOP; +} + static HRESULT WINAPI hid_joystick_GetProperty( IDirectInputDevice8W *iface, const GUID *guid, DIPROPHEADER *header ) { @@ -538,6 +574,24 @@ static HRESULT WINAPI hid_joystick_GetProperty( IDirectInputDevice8W *iface, con if (enum_objects( impl, header, DIDFT_AXIS, get_property_prop_range, header ) == DIENUM_STOP) return DI_OK; return DIERR_NOTFOUND; + case (DWORD_PTR)DIPROP_DEADZONE: + if (header->dwSize != sizeof(DIPROPDWORD)) return DIERR_INVALIDPARAM; + if (header->dwHow == DIPH_DEVICE) return DIERR_UNSUPPORTED; + if (enum_objects( impl, header, DIDFT_AXIS, get_property_prop_deadzone, header ) == DIENUM_STOP) + return DI_OK; + return DIERR_NOTFOUND; + case (DWORD_PTR)DIPROP_SATURATION: + if (header->dwSize != sizeof(DIPROPDWORD)) return DIERR_INVALIDPARAM; + if (header->dwHow == DIPH_DEVICE) return DIERR_UNSUPPORTED; + if (enum_objects( impl, header, DIDFT_AXIS, get_property_prop_saturation, header ) == DIENUM_STOP) + return DI_OK; + return DIERR_NOTFOUND; + case (DWORD_PTR)DIPROP_GRANULARITY: + if (header->dwSize != sizeof(DIPROPDWORD)) return DIERR_INVALIDPARAM; + if (header->dwHow == DIPH_DEVICE) return DIERR_UNSUPPORTED; + if (enum_objects( impl, header, DIDFT_AXIS, get_property_prop_granularity, header ) == DIENUM_STOP) + return DI_OK; + return DIERR_NOTFOUND; case (DWORD_PTR)DIPROP_PRODUCTNAME: { DIPROPSTRING *value = (DIPROPSTRING *)header; @@ -606,6 +660,26 @@ static BOOL set_property_prop_range( struct hid_joystick *impl, struct hid_caps return DIENUM_CONTINUE; }
+static BOOL set_property_prop_deadzone( struct hid_joystick *impl, struct hid_caps *caps, + DIDEVICEOBJECTINSTANCEW *instance, void *data ) +{ + struct extra_caps *extra; + DIPROPDWORD *deadzone = data; + extra = impl->input_extra_caps + (caps->value - impl->input_value_caps); + extra->deadzone = deadzone->dwData; + return DIENUM_CONTINUE; +} + +static BOOL set_property_prop_saturation( struct hid_joystick *impl, struct hid_caps *caps, + DIDEVICEOBJECTINSTANCEW *instance, void *data ) +{ + struct extra_caps *extra; + DIPROPDWORD *saturation = data; + extra = impl->input_extra_caps + (caps->value - impl->input_value_caps); + extra->saturation = saturation->dwData; + return DIENUM_CONTINUE; +} + static HRESULT WINAPI hid_joystick_SetProperty( IDirectInputDevice8W *iface, const GUID *guid, const DIPROPHEADER *header ) { @@ -627,6 +701,22 @@ static HRESULT WINAPI hid_joystick_SetProperty( IDirectInputDevice8W *iface, con enum_objects( impl, header, DIDFT_AXIS, set_property_prop_range, (void *)header ); return DI_OK; } + case (DWORD_PTR)DIPROP_DEADZONE: + { + DIPROPDWORD *value = (DIPROPDWORD *)header; + if (header->dwSize != sizeof(DIPROPDWORD)) return DIERR_INVALIDPARAM; + if (value->dwData > 10000) return DIERR_INVALIDPARAM; + enum_objects( impl, header, DIDFT_AXIS, set_property_prop_deadzone, (void *)header ); + return DI_OK; + } + case (DWORD_PTR)DIPROP_SATURATION: + { + DIPROPDWORD *value = (DIPROPDWORD *)header; + if (header->dwSize != sizeof(DIPROPDWORD)) return DIERR_INVALIDPARAM; + if (value->dwData > 10000) return DIERR_INVALIDPARAM; + enum_objects( impl, header, DIDFT_AXIS, set_property_prop_saturation, (void *)header ); + return DI_OK; + } case (DWORD_PTR)DIPROP_FFLOAD: case (DWORD_PTR)DIPROP_GRANULARITY: case (DWORD_PTR)DIPROP_VIDPID: @@ -859,7 +949,7 @@ static LONG scale_value( ULONG value, const HIDP_VALUE_CAPS *caps, LONG min, LON return min + MulDiv( tmp - caps->LogicalMin, max - min, caps->LogicalMax - caps->LogicalMin ); }
-static LONG scale_axis_value( ULONG value, const HIDP_VALUE_CAPS *caps ) +static LONG scale_axis_value( ULONG value, const HIDP_VALUE_CAPS *caps, struct extra_caps *extra ) { LONG tmp = sign_extend( value, caps ), log_ctr, log_min, log_max, phy_ctr, phy_min, phy_max; ULONG bit_max = (1 << caps->BitSize) - 1; @@ -879,14 +969,14 @@ static LONG scale_axis_value( ULONG value, const HIDP_VALUE_CAPS *caps ) tmp -= log_ctr; if (tmp <= 0) { - log_max = 0; - log_min -= log_ctr; + log_max = MulDiv( log_min - log_ctr, extra->deadzone, 10000 ); + log_min = MulDiv( log_min - log_ctr, extra->saturation, 10000 ); phy_max = phy_ctr; } else { - log_min = 0; - log_max -= log_ctr; + log_min = MulDiv( log_max - log_ctr, extra->deadzone, 10000 ); + log_max = MulDiv( log_max - log_ctr, extra->saturation, 10000 ); phy_min = phy_ctr; }
@@ -903,14 +993,16 @@ static BOOL read_device_state_value( struct hid_joystick *impl, struct hid_caps struct parse_device_state_params *params = data; char *report_buf = impl->input_report_buf; HIDP_VALUE_CAPS *value_caps = caps->value; + struct extra_caps *extra; LONG old_value, value; NTSTATUS status;
+ extra = impl->input_extra_caps + (value_caps - impl->input_value_caps); status = HidP_GetUsageValue( HidP_Input, instance->wUsagePage, 0, instance->wUsage, &logical_value, impl->preparsed, report_buf, report_len ); if (status != HIDP_STATUS_SUCCESS) WARN( "HidP_GetUsageValue %04x:%04x returned %#x\n", instance->wUsagePage, instance->wUsage, status ); - if (instance->dwType & DIDFT_AXIS) value = scale_axis_value( logical_value, value_caps ); + if (instance->dwType & DIDFT_AXIS) value = scale_axis_value( logical_value, value_caps, extra ); else value = scale_value( logical_value, value_caps, value_caps->PhysicalMin, value_caps->PhysicalMax );
old_value = *(LONG *)(params->old_state + instance->dwOfs); @@ -1305,9 +1397,19 @@ static HRESULT hid_joystick_create_device( IDirectInputImpl *dinput, const GUID .dwHow = DIPH_DEVICE, }, }; + DIPROPDWORD saturation = + { + .diph = + { + .dwSize = sizeof(DIPROPDWORD), + .dwHeaderSize = sizeof(DIPROPHEADER), + .dwHow = DIPH_DEVICE, + }, + }; HIDD_ATTRIBUTES attrs = {.Size = sizeof(attrs)}; HIDP_LINK_COLLECTION_NODE *nodes; struct hid_joystick *impl = NULL; + struct extra_caps *extra; DIDATAFORMAT *format = NULL; HIDP_BUTTON_CAPS *buttons; HIDP_VALUE_CAPS *values; @@ -1356,6 +1458,9 @@ static HRESULT hid_joystick_create_device( IDirectInputImpl *dinput, const GUID size = impl->caps.NumberInputValueCaps * sizeof(HIDP_VALUE_CAPS); if (!(values = HeapAlloc( GetProcessHeap(), 0, size ))) goto failed; impl->input_value_caps = values; + size = impl->caps.NumberInputValueCaps * sizeof(struct extra_caps); + if (!(extra = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, size ))) goto failed; + impl->input_extra_caps = extra;
size = impl->caps.InputReportByteLength; if (!(buffer = HeapAlloc( GetProcessHeap(), 0, size ))) goto failed; @@ -1400,6 +1505,8 @@ static HRESULT hid_joystick_create_device( IDirectInputImpl *dinput, const GUID enum_objects( impl, &range.diph, DIDFT_AXIS, set_property_prop_range, &range ); range.lMax = 36000; enum_objects( impl, &range.diph, DIDFT_POV, set_property_prop_range, &range ); + saturation.dwData = 10000; + enum_objects( impl, &range.diph, DIDFT_AXIS, set_property_prop_saturation, &saturation );
*out = &impl->base.IDirectInputDevice8W_iface; return DI_OK; diff --git a/dlls/dinput8/tests/hid.c b/dlls/dinput8/tests/hid.c index ec5dffe70f5..07505797eb1 100644 --- a/dlls/dinput8/tests/hid.c +++ b/dlls/dinput8/tests/hid.c @@ -3867,16 +3867,13 @@ static void test_simple_joystick(void) todo_wine ok( hr == DIERR_UNSUPPORTED, "IDirectInputDevice8_GetProperty DIPROP_AUTOCENTER returned %#x\n", hr ); hr = IDirectInputDevice8_GetProperty( device, DIPROP_DEADZONE, &prop_dword.diph ); - todo_wine ok( hr == DIERR_UNSUPPORTED, "IDirectInputDevice8_GetProperty DIPROP_DEADZONE returned %#x\n", hr ); hr = IDirectInputDevice8_GetProperty( device, DIPROP_FFLOAD, &prop_dword.diph ); todo_wine ok( hr == DIERR_UNSUPPORTED, "IDirectInputDevice8_GetProperty DIPROP_FFLOAD returned %#x\n", hr ); hr = IDirectInputDevice8_GetProperty( device, DIPROP_GRANULARITY, &prop_dword.diph ); - todo_wine ok( hr == DIERR_UNSUPPORTED, "IDirectInputDevice8_GetProperty DIPROP_GRANULARITY returned %#x\n", hr ); hr = IDirectInputDevice8_GetProperty( device, DIPROP_SATURATION, &prop_dword.diph ); - todo_wine ok( hr == DIERR_UNSUPPORTED, "IDirectInputDevice8_GetProperty DIPROP_SATURATION returned %#x\n", hr ); hr = IDirectInputDevice8_GetProperty( device, DIPROP_RANGE, &prop_range.diph ); ok( hr == DIERR_UNSUPPORTED, "IDirectInputDevice8_GetProperty DIPROP_RANGE returned %#x\n", hr ); @@ -3885,21 +3882,15 @@ static void test_simple_joystick(void) prop_dword.diph.dwObj = MAKELONG( HID_USAGE_GENERIC_X, HID_USAGE_PAGE_GENERIC ); prop_dword.dwData = 0xdeadbeef; hr = IDirectInputDevice8_GetProperty( device, DIPROP_DEADZONE, &prop_dword.diph ); - todo_wine ok( hr == DI_OK, "IDirectInputDevice8_GetProperty DIPROP_DEADZONE returned %#x\n", hr ); - todo_wine ok( prop_dword.dwData == 0, "got %u expected %u\n", prop_dword.dwData, 0 ); prop_dword.dwData = 0xdeadbeef; hr = IDirectInputDevice8_GetProperty( device, DIPROP_GRANULARITY, &prop_dword.diph ); - todo_wine ok( hr == DI_OK, "IDirectInputDevice8_GetProperty DIPROP_GRANULARITY returned %#x\n", hr ); - todo_wine ok( prop_dword.dwData == 1, "got %u expected %u\n", prop_dword.dwData, 1 ); prop_dword.dwData = 0xdeadbeef; hr = IDirectInputDevice8_GetProperty( device, DIPROP_SATURATION, &prop_dword.diph ); - todo_wine ok( hr == DI_OK, "IDirectInputDevice8_GetProperty DIPROP_SATURATION returned %#x\n", hr ); - todo_wine ok( prop_dword.dwData == 10000, "got %u expected %u\n", prop_dword.dwData, 10000 );
prop_range.diph.dwHow = DIPH_BYUSAGE; @@ -4368,67 +4359,51 @@ static void test_simple_joystick(void) prop_dword.diph.dwObj = 0; prop_dword.dwData = 10001; hr = IDirectInputDevice8_SetProperty( device, DIPROP_DEADZONE, &prop_dword.diph ); - todo_wine ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_SetProperty DIPROP_DEADZONE returned %#x\n", hr ); hr = IDirectInputDevice8_SetProperty( device, DIPROP_SATURATION, &prop_dword.diph ); - todo_wine ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_SetProperty DIPROP_SATURATION returned %#x\n", hr ); prop_dword.dwData = 1000; hr = IDirectInputDevice8_SetProperty( device, DIPROP_DEADZONE, &prop_dword.diph ); - todo_wine ok( hr == DI_OK, "IDirectInputDevice8_SetProperty DIPROP_DEADZONE returned %#x\n", hr ); prop_dword.dwData = 6000; hr = IDirectInputDevice8_SetProperty( device, DIPROP_SATURATION, &prop_dword.diph ); - todo_wine ok( hr == DI_OK, "IDirectInputDevice8_SetProperty DIPROP_SATURATION returned %#x\n", hr );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_DEADZONE, &prop_dword.diph ); - todo_wine ok( hr == DIERR_UNSUPPORTED, "IDirectInputDevice8_GetProperty DIPROP_DEADZONE returned %#x\n", hr ); hr = IDirectInputDevice8_GetProperty( device, DIPROP_SATURATION, &prop_dword.diph ); - todo_wine ok( hr == DIERR_UNSUPPORTED, "IDirectInputDevice8_GetProperty DIPROP_SATURATION returned %#x\n", hr );
prop_dword.diph.dwHow = DIPH_BYUSAGE; prop_dword.diph.dwObj = MAKELONG( HID_USAGE_GENERIC_X, HID_USAGE_PAGE_GENERIC ); prop_dword.dwData = 2000; hr = IDirectInputDevice8_SetProperty( device, DIPROP_DEADZONE, &prop_dword.diph ); - todo_wine ok( hr == DI_OK, "IDirectInputDevice8_SetProperty DIPROP_DEADZONE returned %#x\n", hr ); ok( prop_dword.dwData == 2000, "got %u expected %u\n", prop_dword.dwData, 2000 ); prop_dword.dwData = 7000; hr = IDirectInputDevice8_SetProperty( device, DIPROP_SATURATION, &prop_dword.diph ); - todo_wine ok( hr == DI_OK, "IDirectInputDevice8_SetProperty DIPROP_SATURATION returned %#x\n", hr );
prop_dword.diph.dwHow = DIPH_BYUSAGE; prop_dword.diph.dwObj = MAKELONG( HID_USAGE_GENERIC_X, HID_USAGE_PAGE_GENERIC ); prop_dword.dwData = 0xdeadbeef; hr = IDirectInputDevice8_GetProperty( device, DIPROP_DEADZONE, &prop_dword.diph ); - todo_wine ok( hr == DI_OK, "IDirectInputDevice8_GetProperty DIPROP_DEADZONE returned %#x\n", hr ); - todo_wine ok( prop_dword.dwData == 2000, "got %u expected %u\n", prop_dword.dwData, 2000 ); prop_dword.dwData = 0xdeadbeef; hr = IDirectInputDevice8_GetProperty( device, DIPROP_SATURATION, &prop_dword.diph ); - todo_wine ok( hr == DI_OK, "IDirectInputDevice8_GetProperty DIPROP_SATURATION returned %#x\n", hr ); - todo_wine ok( prop_dword.dwData == 7000, "got %u expected %u\n", prop_dword.dwData, 7000 );
prop_dword.diph.dwHow = DIPH_BYUSAGE; prop_dword.diph.dwObj = MAKELONG( HID_USAGE_GENERIC_Y, HID_USAGE_PAGE_GENERIC ); prop_dword.dwData = 0xdeadbeef; hr = IDirectInputDevice8_GetProperty( device, DIPROP_DEADZONE, &prop_dword.diph ); - todo_wine ok( hr == DI_OK, "IDirectInputDevice8_GetProperty DIPROP_DEADZONE returned %#x\n", hr ); - todo_wine ok( prop_dword.dwData == 1000, "got %u expected %u\n", prop_dword.dwData, 1000 ); prop_dword.dwData = 0xdeadbeef; hr = IDirectInputDevice8_GetProperty( device, DIPROP_SATURATION, &prop_dword.diph ); - todo_wine ok( hr == DI_OK, "IDirectInputDevice8_GetProperty DIPROP_SATURATION returned %#x\n", hr ); - todo_wine ok( prop_dword.dwData == 6000, "got %u expected %u\n", prop_dword.dwData, 6000 );
for (i = 0; i < ARRAY_SIZE(injected_input); ++i) @@ -4439,9 +4414,7 @@ static void test_simple_joystick(void) if (broken( state.lX == -10750 )) win_skip( "Ignoring 32-bit rounding\n" ); else { - todo_wine_if( i == 3 || i == 4 ) check_member( state, expect_state_abs[i], "%d", lX ); - todo_wine_if( i == 3 || i == 4 ) check_member( state, expect_state_abs[i], "%d", lY ); } check_member( state, expect_state_abs[i], "%d", lZ ); @@ -4465,7 +4438,6 @@ static void test_simple_joystick(void) ok( hr == DI_OK, "IDirectInputDevice8_GetDeviceState returned: %#x\n", hr ); winetest_push_context( "state[%d]", i ); check_member( state, expect_state_abs[i], "%d", lX ); - todo_wine check_member( state, expect_state_abs[i], "%d", lY ); check_member( state, expect_state_abs[i], "%d", lZ ); check_member( state, expect_state_abs[i], "%d", lRx ); @@ -4547,11 +4519,9 @@ static void test_simple_joystick(void) ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_SetProperty DIPROP_CALIBRATION returned %#x\n", hr ); prop_dword.dwData = 0xdeadbeef; hr = IDirectInputDevice8_SetProperty( device, DIPROP_DEADZONE, &prop_dword.diph ); - todo_wine ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_SetProperty DIPROP_DEADZONE returned %#x\n", hr ); prop_dword.dwData = 0xdeadbeef; hr = IDirectInputDevice8_SetProperty( device, DIPROP_SATURATION, &prop_dword.diph ); - todo_wine ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_SetProperty DIPROP_SATURATION returned %#x\n", hr );
for (i = 0; i < ARRAY_SIZE(injected_input); ++i)
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/dinput/joystick_hid.c | 15 +++++++++++++++ dlls/dinput8/tests/hid.c | 3 --- 2 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/dlls/dinput/joystick_hid.c b/dlls/dinput/joystick_hid.c index 4ce60e67faf..a8f8077863b 100644 --- a/dlls/dinput/joystick_hid.c +++ b/dlls/dinput/joystick_hid.c @@ -628,6 +628,9 @@ static HRESULT WINAPI hid_joystick_GetProperty( IDirectInputDevice8W *iface, con lstrcpynW( value->wszPath, impl->device_path, MAX_PATH ); return DI_OK; } + case (DWORD_PTR)DIPROP_AUTOCENTER: + if (header->dwSize != sizeof(DIPROPDWORD)) return DIERR_INVALIDPARAM; + return DIERR_UNSUPPORTED; default: return IDirectInputDevice2WImpl_GetProperty( iface, guid, header ); } @@ -684,6 +687,7 @@ static HRESULT WINAPI hid_joystick_SetProperty( IDirectInputDevice8W *iface, con const DIPROPHEADER *header ) { struct hid_joystick *impl = impl_from_IDirectInputDevice8W( iface ); + HRESULT hr;
TRACE( "iface %p, guid %s, header %p\n", iface, debugstr_guid( guid ), header );
@@ -717,6 +721,17 @@ static HRESULT WINAPI hid_joystick_SetProperty( IDirectInputDevice8W *iface, con enum_objects( impl, header, DIDFT_AXIS, set_property_prop_saturation, (void *)header ); return DI_OK; } + case (DWORD_PTR)DIPROP_AUTOCENTER: + { + DIPROPDWORD *value = (DIPROPDWORD *)header; + if (header->dwSize != sizeof(DIPROPDWORD)) return DIERR_INVALIDPARAM; + EnterCriticalSection( &impl->base.crit ); + if (impl->base.acquired) hr = DIERR_ACQUIRED; + else if (value->dwData > DIPROPAUTOCENTER_ON) hr = DIERR_INVALIDPARAM; + else hr = DIERR_UNSUPPORTED; + LeaveCriticalSection( &impl->base.crit ); + return hr; + } case (DWORD_PTR)DIPROP_FFLOAD: case (DWORD_PTR)DIPROP_GRANULARITY: case (DWORD_PTR)DIPROP_VIDPID: diff --git a/dlls/dinput8/tests/hid.c b/dlls/dinput8/tests/hid.c index 07505797eb1..848619bd468 100644 --- a/dlls/dinput8/tests/hid.c +++ b/dlls/dinput8/tests/hid.c @@ -3864,7 +3864,6 @@ static void test_simple_joystick(void) hr = IDirectInputDevice8_GetProperty( device, DIPROP_CALIBRATION, &prop_dword.diph ); ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_GetProperty DIPROP_CALIBRATION returned %#x\n", hr ); hr = IDirectInputDevice8_GetProperty( device, DIPROP_AUTOCENTER, &prop_dword.diph ); - todo_wine ok( hr == DIERR_UNSUPPORTED, "IDirectInputDevice8_GetProperty DIPROP_AUTOCENTER returned %#x\n", hr ); hr = IDirectInputDevice8_GetProperty( device, DIPROP_DEADZONE, &prop_dword.diph ); ok( hr == DIERR_UNSUPPORTED, "IDirectInputDevice8_GetProperty DIPROP_DEADZONE returned %#x\n", hr ); @@ -4347,7 +4346,6 @@ static void test_simple_joystick(void) hr = IDirectInputDevice8_SetProperty( device, DIPROP_BUFFERSIZE, &prop_dword.diph ); ok( hr == DIERR_ACQUIRED, "IDirectInputDevice8_SetProperty DIPROP_BUFFERSIZE returned %#x\n", hr ); hr = IDirectInputDevice8_SetProperty( device, DIPROP_AUTOCENTER, &prop_dword.diph ); - todo_wine ok( hr == DIERR_ACQUIRED, "IDirectInputDevice8_SetProperty DIPROP_AUTOCENTER returned %#x\n", hr ); prop_pointer.diph.dwHow = DIPH_BYUSAGE; prop_pointer.diph.dwObj = MAKELONG( HID_USAGE_GENERIC_X, HID_USAGE_PAGE_GENERIC ); @@ -4460,7 +4458,6 @@ static void test_simple_joystick(void) ok( hr == DI_OK, "IDirectInputDevice8_SetProperty DIPROP_BUFFERSIZE returned %#x\n", hr ); prop_dword.dwData = 0xdeadbeef; hr = IDirectInputDevice8_SetProperty( device, DIPROP_AUTOCENTER, &prop_dword.diph ); - todo_wine ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_SetProperty DIPROP_AUTOCENTER returned %#x\n", hr ); prop_dword.dwData = DIPROPAUTOCENTER_ON; hr = IDirectInputDevice8_SetProperty( device, DIPROP_AUTOCENTER, &prop_dword.diph );
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/dinput/joystick_hid.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/dlls/dinput/joystick_hid.c b/dlls/dinput/joystick_hid.c index a8f8077863b..29cb8990689 100644 --- a/dlls/dinput/joystick_hid.c +++ b/dlls/dinput/joystick_hid.c @@ -359,9 +359,7 @@ static BOOL enum_objects( struct hid_joystick *impl, const DIPROPHEADER *header, TRACE( "Ignoring input button %s, usage page not implemented.\n", debugstr_hid_caps( &caps ) ); else if (caps.button->IsRange) { - if (caps.button->NotRange.Usage >= 128) - FIXME( "Ignoring input button %s, too many buttons.\n", debugstr_hid_caps( &caps ) ); - else for (j = caps.button->Range.UsageMin; j <= caps.button->Range.UsageMax; ++j) + for (j = caps.button->Range.UsageMin; j <= caps.button->Range.UsageMax; ++j) { instance.dwOfs = button_ofs + (j - caps.button->Range.UsageMin); instance.dwType = DIDFT_PSHBUTTON | DIDFT_MAKEINSTANCE( button++ ); @@ -375,8 +373,6 @@ static BOOL enum_objects( struct hid_joystick *impl, const DIPROPHEADER *header, if (ret != DIENUM_CONTINUE) return ret; } } - else if (caps.button->NotRange.Usage >= 128) - FIXME( "Ignoring input button %s, too many buttons.\n", debugstr_hid_caps( &caps ) ); else { instance.dwOfs = button_ofs;