dinput: Add DIDFT_FFEFFECTTRIGGER flag on trigger buttons.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
1285bbfa43
commit
489c62f9eb
|
@ -285,7 +285,7 @@ static BOOL enum_objects( struct hid_joystick *impl, const DIPROPHEADER *header,
|
|||
DWORD collection = 0, object = 0, axis = 0, button = 0, pov = 0, value_ofs = 0, button_ofs = 0, i, j;
|
||||
struct hid_preparsed_data *preparsed = (struct hid_preparsed_data *)impl->preparsed;
|
||||
DIDEVICEOBJECTINSTANCEW instance = {.dwSize = sizeof(DIDEVICEOBJECTINSTANCEW)};
|
||||
struct hid_value_caps *caps, *caps_end, *nary, *nary_end;
|
||||
struct hid_value_caps *caps, *caps_end, *nary, *nary_end, *effect_caps;
|
||||
DIDATAFORMAT *format = impl->base.data_format.wine_df;
|
||||
int *offsets = impl->base.data_format.offsets;
|
||||
struct hid_collection_node *node, *node_end;
|
||||
|
@ -356,6 +356,8 @@ static BOOL enum_objects( struct hid_joystick *impl, const DIPROPHEADER *header,
|
|||
}
|
||||
}
|
||||
|
||||
effect_caps = impl->pid_effect_update.trigger_button_caps;
|
||||
|
||||
for (caps = HID_INPUT_VALUE_CAPS( preparsed ), caps_end = caps + preparsed->input_caps_count;
|
||||
caps != caps_end; ++caps)
|
||||
{
|
||||
|
@ -372,6 +374,11 @@ static BOOL enum_objects( struct hid_joystick *impl, const DIPROPHEADER *header,
|
|||
instance.dwOfs = button_ofs;
|
||||
instance.dwType = DIDFT_PSHBUTTON | DIDFT_MAKEINSTANCE( button++ );
|
||||
instance.dwFlags = 0;
|
||||
if (effect_caps && effect_caps->logical_min <= j && effect_caps->logical_max >= j)
|
||||
{
|
||||
instance.dwType |= DIDFT_FFEFFECTTRIGGER;
|
||||
instance.dwFlags |= DIDOI_FFEFFECTTRIGGER;
|
||||
}
|
||||
instance.wUsagePage = caps->usage_page;
|
||||
instance.wUsage = j;
|
||||
instance.guidType = *object_usage_to_guid( instance.wUsagePage, instance.wUsage );
|
||||
|
|
|
@ -3294,8 +3294,6 @@ static BOOL CALLBACK find_test_device( const DIDEVICEINSTANCEW *devinst, void *c
|
|||
|
||||
struct check_objects_todos
|
||||
{
|
||||
BOOL type;
|
||||
BOOL flags;
|
||||
BOOL dimension;
|
||||
BOOL exponent;
|
||||
};
|
||||
|
@ -3323,9 +3321,7 @@ static BOOL CALLBACK check_objects( const DIDEVICEOBJECTINSTANCEW *obj, void *ar
|
|||
check_member( *obj, *exp, "%u", dwSize );
|
||||
check_member_guid( *obj, *exp, guidType );
|
||||
check_member( *obj, *exp, "%#x", dwOfs );
|
||||
todo_wine_if( todo->type )
|
||||
check_member( *obj, *exp, "%#x", dwType );
|
||||
todo_wine_if( todo->flags )
|
||||
check_member( *obj, *exp, "%#x", dwFlags );
|
||||
if (!localized) todo_wine check_member_wstr( *obj, *exp, tszName );
|
||||
check_member( *obj, *exp, "%u", dwFFMaxForce );
|
||||
|
@ -6395,8 +6391,8 @@ static void test_force_feedback_joystick( void )
|
|||
{},
|
||||
{},
|
||||
{},
|
||||
{.type = TRUE, .flags = TRUE},
|
||||
{.type = TRUE, .flags = TRUE},
|
||||
{},
|
||||
{},
|
||||
{},
|
||||
{},
|
||||
{},
|
||||
|
|
Loading…
Reference in New Issue