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
7e854933
Commit
7e854933
authored
Nov 26, 2022
by
Rémi Bernon
Committed by
Alexandre Julliard
Nov 28, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
joy.cpl: Read the number of buttons instead of storing it.
parent
b53df5df
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
7 deletions
+3
-7
main.c
dlls/joy.cpl/main.c
+3
-7
No files found.
dlls/joy.cpl/main.c
View file @
7e854933
...
...
@@ -78,8 +78,6 @@ struct effect
struct
Joystick
{
IDirectInputDevice8W
*
device
;
int
num_buttons
;
int
num_axes
;
BOOL
forcefeedback
;
BOOL
is_xinput
;
BOOL
has_override
;
...
...
@@ -249,8 +247,6 @@ static BOOL CALLBACK enum_callback(const DIDEVICEINSTANCEW *instance, void *cont
caps
.
dwSize
=
sizeof
(
caps
);
IDirectInputDevice8_GetCapabilities
(
joystick
->
device
,
&
caps
);
joystick
->
num_buttons
=
caps
.
dwButtons
;
joystick
->
num_axes
=
caps
.
dwAxes
;
joystick
->
forcefeedback
=
caps
.
dwFlags
&
DIDC_FORCEFEEDBACK
;
IDirectInputDevice8_GetProperty
(
joystick
->
device
,
DIPROP_GUIDANDPATH
,
&
prop_guid_path
.
diph
);
...
...
@@ -668,15 +664,15 @@ static DWORD WINAPI input_thread(void *param)
static
void
test_handle_joychange
(
HWND
hwnd
,
struct
JoystickData
*
data
)
{
DIDEVCAPS
caps
=
{.
dwSize
=
sizeof
(
DIDEVCAPS
)};
int
i
;
if
(
data
->
num_joysticks
==
0
)
return
;
data
->
chosen_joystick
=
SendDlgItemMessageW
(
hwnd
,
IDC_TESTSELECTCOMBO
,
CB_GETCURSEL
,
0
,
0
);
if
(
FAILED
(
IDirectInputDevice8_GetCapabilities
(
data
->
joysticks
[
data
->
chosen_joystick
].
device
,
&
caps
)))
return
;
/* Enable only buttons present in the device */
for
(
i
=
0
;
i
<
TEST_MAX_BUTTONS
;
i
++
)
ShowWindow
(
data
->
graphics
.
buttons
[
i
],
i
<
data
->
joysticks
[
data
->
chosen_joystick
].
num_buttons
);
for
(
i
=
0
;
i
<
TEST_MAX_BUTTONS
;
i
++
)
ShowWindow
(
data
->
graphics
.
buttons
[
i
],
i
<
caps
.
dwButtons
);
}
/*********************************************************************
...
...
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