Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
a4f7ef29
Commit
a4f7ef29
authored
Feb 15, 2022
by
Rémi Bernon
Committed by
Alexandre Julliard
Feb 15, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
xinput1_3: Use the implicit Stop waveform ordinal to stop the effects.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
3a95a4a0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
main.c
dlls/xinput1_3/main.c
+20
-0
No files found.
dlls/xinput1_3/main.c
View file @
a4f7ef29
...
@@ -81,6 +81,8 @@ struct xinput_controller
...
@@ -81,6 +81,8 @@ struct xinput_controller
char
*
feature_report_buf
;
char
*
feature_report_buf
;
BYTE
haptics_report
;
BYTE
haptics_report
;
BYTE
haptics_none_ordinal
;
BYTE
haptics_stop_ordinal
;
BYTE
haptics_rumble_ordinal
;
BYTE
haptics_rumble_ordinal
;
BYTE
haptics_buzz_ordinal
;
BYTE
haptics_buzz_ordinal
;
}
hid
;
}
hid
;
...
@@ -244,6 +246,8 @@ static BOOL controller_check_caps(struct xinput_controller *controller, HANDLE d
...
@@ -244,6 +246,8 @@ static BOOL controller_check_caps(struct xinput_controller *controller, HANDLE d
return
TRUE
;
return
TRUE
;
}
}
controller
->
hid
.
haptics_none_ordinal
=
1
;
/* implicit None waveform ordinal, from the HID spec */
controller
->
hid
.
haptics_stop_ordinal
=
2
;
/* implicit Stop waveform ordinal, from the HID spec */
controller
->
hid
.
haptics_buzz_ordinal
=
0
;
controller
->
hid
.
haptics_buzz_ordinal
=
0
;
controller
->
hid
.
haptics_rumble_ordinal
=
0
;
controller
->
hid
.
haptics_rumble_ordinal
=
0
;
for
(
i
=
3
;
status
==
HIDP_STATUS_SUCCESS
;
++
i
)
for
(
i
=
3
;
status
==
HIDP_STATUS_SUCCESS
;
++
i
)
...
@@ -291,6 +295,22 @@ static DWORD HID_set_state(struct xinput_controller *controller, XINPUT_VIBRATIO
...
@@ -291,6 +295,22 @@ static DWORD HID_set_state(struct xinput_controller *controller, XINPUT_VIBRATIO
if
(
!
controller
->
enabled
)
return
ERROR_SUCCESS
;
if
(
!
controller
->
enabled
)
return
ERROR_SUCCESS
;
if
(
!
state
->
wLeftMotorSpeed
&&
!
state
->
wRightMotorSpeed
)
{
status
=
HidP_InitializeReportForID
(
HidP_Output
,
report_id
,
preparsed
,
report_buf
,
report_len
);
if
(
status
!=
HIDP_STATUS_SUCCESS
)
WARN
(
"HidP_InitializeReportForID returned %#lx
\n
"
,
status
);
status
=
HidP_SetUsageValue
(
HidP_Output
,
HID_USAGE_PAGE_HAPTICS
,
0
,
HID_USAGE_HAPTICS_MANUAL_TRIGGER
,
controller
->
hid
.
haptics_stop_ordinal
,
preparsed
,
report_buf
,
report_len
);
if
(
status
!=
HIDP_STATUS_SUCCESS
)
WARN
(
"HidP_SetUsageValue MANUAL_TRIGGER returned %#lx
\n
"
,
status
);
if
(
!
HidD_SetOutputReport
(
controller
->
device
,
report_buf
,
report_len
))
{
WARN
(
"HidD_SetOutputReport failed with error %lu
\n
"
,
GetLastError
());
return
GetLastError
();
}
return
0
;
}
/* send haptics rumble report (left motor) */
/* send haptics rumble report (left motor) */
status
=
HidP_InitializeReportForID
(
HidP_Output
,
report_id
,
preparsed
,
report_buf
,
report_len
);
status
=
HidP_InitializeReportForID
(
HidP_Output
,
report_id
,
preparsed
,
report_buf
,
report_len
);
if
(
status
!=
HIDP_STATUS_SUCCESS
)
WARN
(
"HidP_InitializeReportForID returned %#lx
\n
"
,
status
);
if
(
status
!=
HIDP_STATUS_SUCCESS
)
WARN
(
"HidP_InitializeReportForID returned %#lx
\n
"
,
status
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment