Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
3da6f175
Commit
3da6f175
authored
Aug 24, 2012
by
Lucas Zawacki
Committed by
Alexandre Julliard
Aug 24, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput: Disable linuxinput or linux joysticks based on registry key.
parent
8bfb1256
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
0 deletions
+44
-0
joystick.c
dlls/dinput/joystick.c
+38
-0
joystick_linux.c
dlls/dinput/joystick_linux.c
+2
-0
joystick_linuxinput.c
dlls/dinput/joystick_linuxinput.c
+2
-0
joystick_private.h
dlls/dinput/joystick_private.h
+2
-0
No files found.
dlls/dinput/joystick.c
View file @
3da6f175
...
...
@@ -49,6 +49,44 @@ static inline IDirectInputDevice8W *IDirectInputDevice8W_from_impl(JoystickGener
return
&
This
->
base
.
IDirectInputDevice8W_iface
;
}
BOOL
device_disabled_registry
(
const
char
*
name
)
{
static
const
char
*
disabled_str
=
"disabled"
;
static
const
char
*
joystick_key
=
"Joysticks"
;
char
buffer
[
MAX_PATH
];
HKEY
hkey
,
appkey
,
temp
;
BOOL
do_disable
=
FALSE
;
get_app_key
(
&
hkey
,
&
appkey
);
/* Joystick settings are in the 'joysticks' subkey */
if
(
appkey
)
{
if
(
RegOpenKeyA
(
appkey
,
joystick_key
,
&
temp
))
temp
=
0
;
RegCloseKey
(
appkey
);
appkey
=
temp
;
}
if
(
hkey
)
{
if
(
RegOpenKeyA
(
hkey
,
joystick_key
,
&
temp
))
temp
=
0
;
RegCloseKey
(
hkey
);
hkey
=
temp
;
}
/* Look for the "controllername"="disabled" key */
if
(
!
get_config_key
(
hkey
,
appkey
,
name
,
buffer
,
sizeof
(
buffer
)))
if
(
!
strncmp
(
disabled_str
,
buffer
,
sizeof
(
disabled_str
)))
{
TRACE
(
"Disabling joystick '%s' based on registry key.
\n
"
,
name
);
do_disable
=
TRUE
;
}
if
(
appkey
)
RegCloseKey
(
appkey
);
if
(
hkey
)
RegCloseKey
(
hkey
);
return
do_disable
;
}
/******************************************************************************
* SetProperty : change input device properties
*/
...
...
dlls/dinput/joystick_linux.c
View file @
3da6f175
...
...
@@ -158,6 +158,8 @@ static INT find_joystick_devices(void)
/* Append driver name */
strcat
(
joydev
.
name
,
JOYDEVDRIVER
);
if
(
device_disabled_registry
(
joydev
.
name
))
continue
;
#ifdef JSIOCGAXES
if
(
ioctl
(
fd
,
JSIOCGAXES
,
&
joydev
.
axis_count
)
<
0
)
{
...
...
dlls/dinput/joystick_linuxinput.c
View file @
3da6f175
...
...
@@ -251,6 +251,8 @@ static void find_joydevs(void)
else
joydev
.
name
=
joydev
.
device
;
if
(
device_disabled_registry
(
joydev
.
name
))
continue
;
joydev
.
guid
=
DInput_Wine_Joystick_Base_GUID
;
joydev
.
guid
.
Data3
+=
have_joydevs
;
...
...
dlls/dinput/joystick_private.h
View file @
3da6f175
...
...
@@ -57,6 +57,8 @@ HRESULT setup_dinput_options(JoystickGenericImpl *This, const int *default_axis_
DWORD
joystick_map_pov
(
const
POINTL
*
p
)
DECLSPEC_HIDDEN
;
BOOL
device_disabled_registry
(
const
char
*
name
)
DECLSPEC_HIDDEN
;
HRESULT
WINAPI
JoystickWGenericImpl_GetObjectInfo
(
LPDIRECTINPUTDEVICE8W
iface
,
LPDIDEVICEOBJECTINSTANCEW
pdidoi
,
DWORD
dwObj
,
DWORD
dwHow
)
DECLSPEC_HIDDEN
;
...
...
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