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
6a8ae41c
Commit
6a8ae41c
authored
Dec 13, 2004
by
Christian Costa
Committed by
Alexandre Julliard
Dec 13, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle device class in DX8 enumeration (found by Robert Reif).
Fixed remaining DX8 device types. Factorized a bit GetCapabilities for keyboard and mouse.
parent
dd30516f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
67 additions
and
68 deletions
+67
-68
joystick_linux.c
dlls/dinput/joystick_linux.c
+8
-11
joystick_linuxinput.c
dlls/dinput/joystick_linuxinput.c
+10
-4
keyboard.c
dlls/dinput/keyboard.c
+26
-28
mouse.c
dlls/dinput/mouse.c
+23
-25
No files found.
dlls/dinput/joystick_linux.c
View file @
6a8ae41c
...
...
@@ -159,7 +159,7 @@ static BOOL joydev_enum_deviceA(DWORD dwDevType, DWORD dwFlags, LPDIDEVICEINSTAN
if
((
dwDevType
==
0
)
||
((
dwDevType
==
DIDEVTYPE_JOYSTICK
)
&&
(
version
<
8
))
||
((
dwDevType
==
DI8DEVTYPE_JOYSTICK
)
&&
(
version
>=
8
)))
{
((
(
dwDevType
==
DI8DEVCLASS_GAMECTRL
)
||
(
dwDevType
==
DI8DEVTYPE_JOYSTICK
)
)
&&
(
version
>=
8
)))
{
/* check whether we have a joystick */
sprintf
(
dev
,
"%s%d"
,
JOYDEV
,
id
);
if
((
fd
=
open
(
dev
,
O_RDONLY
))
<
0
)
{
...
...
@@ -209,7 +209,7 @@ static BOOL joydev_enum_deviceW(DWORD dwDevType, DWORD dwFlags, LPDIDEVICEINSTAN
if
((
dwDevType
==
0
)
||
((
dwDevType
==
DIDEVTYPE_JOYSTICK
)
&&
(
version
<
8
))
||
((
dwDevType
==
DI8DEVTYPE_JOYSTICK
)
&&
(
version
>=
8
)))
{
((
(
dwDevType
==
DI8DEVCLASS_GAMECTRL
)
||
(
dwDevType
==
DI8DEVTYPE_JOYSTICK
)
)
&&
(
version
>=
8
)))
{
/* check whether we have a joystick */
sprintf
(
dev
,
"%s%d"
,
JOYDEV
,
id
);
if
((
fd
=
open
(
dev
,
O_RDONLY
))
<
0
)
{
...
...
@@ -556,7 +556,10 @@ static HRESULT alloc_device(REFGUID rguid, LPVOID jvt, IDirectInputImpl *dinput,
newDevice
->
devcaps
.
dwSize
=
sizeof
(
newDevice
->
devcaps
);
newDevice
->
devcaps
.
dwFlags
=
DIDC_ATTACHED
;
newDevice
->
devcaps
.
dwDevType
=
DIDEVTYPE_JOYSTICK
;
if
(
newDevice
->
dinput
->
version
>=
8
)
newDevice
->
devcaps
.
dwDevType
=
DI8DEVTYPE_JOYSTICK
|
(
DI8DEVTYPEJOYSTICK_STANDARD
<<
8
);
else
newDevice
->
devcaps
.
dwDevType
=
DIDEVTYPE_JOYSTICK
|
(
DIDEVTYPEJOYSTICK_TRADITIONAL
<<
8
);
newDevice
->
devcaps
.
dwFFSamplePeriod
=
0
;
newDevice
->
devcaps
.
dwFFMinTimeResolution
=
0
;
newDevice
->
devcaps
.
dwFirmwareRevision
=
0
;
...
...
@@ -1582,10 +1585,7 @@ HRESULT WINAPI JoystickAImpl_GetDeviceInfo(
pdidi
->
guidInstance
=
GUID_Joystick
;
pdidi
->
guidProduct
=
DInput_Wine_Joystick_GUID
;
/* we only support traditional joysticks for now */
if
(
This
->
dinput
->
version
>=
8
)
pdidi
->
dwDevType
=
DI8DEVTYPE_JOYSTICK
|
(
DI8DEVTYPEJOYSTICK_STANDARD
<<
8
);
else
pdidi
->
dwDevType
=
DIDEVTYPE_JOYSTICK
|
(
DIDEVTYPEJOYSTICK_TRADITIONAL
<<
8
);
pdidi
->
dwDevType
=
This
->
devcaps
.
dwDevType
;
strcpy
(
pdidi
->
tszInstanceName
,
"Joystick"
);
strcpy
(
pdidi
->
tszProductName
,
This
->
name
);
if
(
pdidi
->
dwSize
>
sizeof
(
DIDEVICEINSTANCE_DX3A
))
{
...
...
@@ -1620,10 +1620,7 @@ HRESULT WINAPI JoystickWImpl_GetDeviceInfo(
pdidi
->
guidInstance
=
GUID_Joystick
;
pdidi
->
guidProduct
=
DInput_Wine_Joystick_GUID
;
/* we only support traditional joysticks for now */
if
(
This
->
dinput
->
version
>=
8
)
pdidi
->
dwDevType
=
DI8DEVTYPE_JOYSTICK
|
(
DI8DEVTYPEJOYSTICK_STANDARD
<<
8
);
else
pdidi
->
dwDevType
=
DIDEVTYPE_JOYSTICK
|
(
DIDEVTYPEJOYSTICK_TRADITIONAL
<<
8
);
pdidi
->
dwDevType
=
This
->
devcaps
.
dwDevType
;
MultiByteToWideChar
(
CP_ACP
,
0
,
"Joystick"
,
-
1
,
pdidi
->
tszInstanceName
,
MAX_PATH
);
MultiByteToWideChar
(
CP_ACP
,
0
,
This
->
name
,
-
1
,
pdidi
->
tszProductName
,
MAX_PATH
);
if
(
pdidi
->
dwSize
>
sizeof
(
DIDEVICEINSTANCE_DX3W
))
{
...
...
dlls/dinput/joystick_linuxinput.c
View file @
6a8ae41c
...
...
@@ -177,7 +177,7 @@ static BOOL joydev_enum_deviceA(DWORD dwDevType, DWORD dwFlags, LPDIDEVICEINSTAN
if
(
!
((
dwDevType
==
0
)
||
((
dwDevType
==
DIDEVTYPE_JOYSTICK
)
&&
(
version
<
8
))
||
((
dwDevType
==
DI8DEVTYPE_JOYSTICK
)
&&
(
version
>=
8
))))
((
(
dwDevType
==
DI8DEVCLASS_GAMECTRL
)
||
(
dwDevType
==
DI8DEVTYPE_JOYSTICK
)
)
&&
(
version
>=
8
))))
return
FALSE
;
if
(
dwFlags
&
DIEDFL_FORCEFEEDBACK
)
...
...
@@ -215,7 +215,7 @@ static BOOL joydev_enum_deviceW(DWORD dwDevType, DWORD dwFlags, LPDIDEVICEINSTAN
if
(
!
((
dwDevType
==
0
)
||
((
dwDevType
==
DIDEVTYPE_JOYSTICK
)
&&
(
version
<
8
))
||
((
dwDevType
==
DI8DEVTYPE_JOYSTICK
)
&&
(
version
>=
8
))))
((
(
dwDevType
==
DI8DEVCLASS_GAMECTRL
)
||
(
dwDevType
==
DI8DEVTYPE_JOYSTICK
)
)
&&
(
version
>=
8
))))
return
FALSE
;
if
(
dwFlags
&
DIEDFL_FORCEFEEDBACK
)
...
...
@@ -233,7 +233,10 @@ static BOOL joydev_enum_deviceW(DWORD dwDevType, DWORD dwFlags, LPDIDEVICEINSTAN
lpddi
->
guidProduct
=
DInput_Wine_Joystick_GUID
;
lpddi
->
guidFFDriver
=
GUID_NULL
;
lpddi
->
dwDevType
=
DIDEVTYPE_JOYSTICK
|
(
DIDEVTYPEJOYSTICK_TRADITIONAL
<<
8
);
if
(
version
>=
8
)
lpddi
->
dwDevType
=
DI8DEVTYPE_JOYSTICK
|
(
DI8DEVTYPEJOYSTICK_STANDARD
<<
8
);
else
lpddi
->
dwDevType
=
DIDEVTYPE_JOYSTICK
|
(
DIDEVTYPEJOYSTICK_TRADITIONAL
<<
8
);
MultiByteToWideChar
(
CP_ACP
,
0
,
"Joystick"
,
-
1
,
lpddi
->
tszInstanceName
,
MAX_PATH
);
/* ioctl JSIOCGNAME(len) */
...
...
@@ -760,7 +763,10 @@ static HRESULT WINAPI JoystickAImpl_GetCapabilities(
wasacquired
=
0
;
}
lpDIDevCaps
->
dwFlags
=
DIDC_ATTACHED
;
lpDIDevCaps
->
dwDevType
=
DIDEVTYPE_JOYSTICK
;
if
(
This
->
dinput
->
version
>=
8
)
lpDIDevCaps
->
dwDevType
=
DI8DEVTYPE_JOYSTICK
|
(
DI8DEVTYPEJOYSTICK_STANDARD
<<
8
);
else
lpDIDevCaps
->
dwDevType
=
DIDEVTYPE_JOYSTICK
|
(
DIDEVTYPEJOYSTICK_TRADITIONAL
<<
8
);
axes
=
0
;
for
(
i
=
0
;
i
<
ABS_MAX
;
i
++
)
if
(
test_bit
(
This
->
absbits
,
i
))
axes
++
;
...
...
dlls/dinput/keyboard.c
View file @
6a8ae41c
...
...
@@ -206,7 +206,7 @@ static BOOL keyboarddev_enum_deviceA(DWORD dwDevType, DWORD dwFlags, LPDIDEVICEI
if
((
dwDevType
==
0
)
||
((
dwDevType
==
DIDEVTYPE_KEYBOARD
)
&&
(
version
<
8
))
||
((
dwDevType
==
DI8DEVTYPE_KEYBOARD
)
&&
(
version
>=
8
)))
{
((
(
dwDevType
==
DI8DEVCLASS_KEYBOARD
)
||
(
dwDevType
==
DI8DEVTYPE_KEYBOARD
)
)
&&
(
version
>=
8
)))
{
TRACE
(
"Enumerating the Keyboard device
\n
"
);
fill_keyboard_dideviceinstanceA
(
lpddi
,
version
);
...
...
@@ -224,7 +224,7 @@ static BOOL keyboarddev_enum_deviceW(DWORD dwDevType, DWORD dwFlags, LPDIDEVICEI
if
((
dwDevType
==
0
)
||
((
dwDevType
==
DIDEVTYPE_KEYBOARD
)
&&
(
version
<
8
))
||
((
dwDevType
==
DI8DEVTYPE_KEYBOARD
)
&&
(
version
>=
8
)))
{
((
(
dwDevType
==
DI8DEVCLASS_KEYBOARD
)
||
(
dwDevType
==
DI8DEVTYPE_KEYBOARD
)
)
&&
(
version
>=
8
)))
{
TRACE
(
"Enumerating the Keyboard device
\n
"
);
fill_keyboard_dideviceinstanceW
(
lpddi
,
version
);
...
...
@@ -569,36 +569,34 @@ static HRESULT WINAPI SysKeyboardAImpl_GetCapabilities(
LPDIRECTINPUTDEVICE8A
iface
,
LPDIDEVCAPS
lpDIDevCaps
)
{
SysKeyboardImpl
*
This
=
(
SysKeyboardImpl
*
)
iface
;
SysKeyboardImpl
*
This
=
(
SysKeyboardImpl
*
)
iface
;
DIDEVCAPS
devcaps
;
TRACE
(
"(this=%p,%p)
\n
"
,
This
,
lpDIDevCaps
);
TRACE
(
"(this=%p,%p)
\n
"
,
This
,
lpDIDevCaps
);
if
(
lpDIDevCaps
->
dwSize
==
sizeof
(
DIDEVCAPS
))
{
lpDIDevCaps
->
dwFlags
=
DIDC_ATTACHED
;
if
((
lpDIDevCaps
->
dwSize
!=
sizeof
(
DIDEVCAPS
))
&&
(
lpDIDevCaps
->
dwSize
!=
sizeof
(
DIDEVCAPS_DX3
)))
{
WARN
(
"invalid parameter
\n
"
);
return
DIERR_INVALIDPARAM
;
}
devcaps
.
dwSize
=
lpDIDevCaps
->
dwSize
;
devcaps
.
dwFlags
=
DIDC_ATTACHED
;
if
(
This
->
dinput
->
version
>=
8
)
lpDIDevCaps
->
dwDevType
=
DI8DEVTYPE_KEYBOARD
|
(
DI8DEVTYPEKEYBOARD_UNKNOWN
<<
8
);
devcaps
.
dwDevType
=
DI8DEVTYPE_KEYBOARD
|
(
DI8DEVTYPEKEYBOARD_UNKNOWN
<<
8
);
else
lpDIDevCaps
->
dwDevType
=
DIDEVTYPE_KEYBOARD
|
(
DIDEVTYPEKEYBOARD_UNKNOWN
<<
8
);
lpDIDevCaps
->
dwAxes
=
0
;
lpDIDevCaps
->
dwButtons
=
256
;
lpDIDevCaps
->
dwPOVs
=
0
;
lpDIDevCaps
->
dwFFSamplePeriod
=
0
;
lpDIDevCaps
->
dwFFMinTimeResolution
=
0
;
lpDIDevCaps
->
dwFirmwareRevision
=
100
;
lpDIDevCaps
->
dwHardwareRevision
=
100
;
lpDIDevCaps
->
dwFFDriverVersion
=
0
;
}
else
if
(
lpDIDevCaps
->
dwSize
==
sizeof
(
DIDEVCAPS_DX3
))
{
lpDIDevCaps
->
dwFlags
=
DIDC_ATTACHED
;
lpDIDevCaps
->
dwDevType
=
DIDEVTYPE_KEYBOARD
|
(
DIDEVTYPEKEYBOARD_UNKNOWN
<<
8
);
lpDIDevCaps
->
dwAxes
=
0
;
lpDIDevCaps
->
dwButtons
=
256
;
lpDIDevCaps
->
dwPOVs
=
0
;
}
else
{
WARN
(
"invalid parameter
\n
"
);
return
DIERR_INVALIDPARAM
;
}
return
DI_OK
;
devcaps
.
dwDevType
=
DIDEVTYPE_KEYBOARD
|
(
DIDEVTYPEKEYBOARD_UNKNOWN
<<
8
);
devcaps
.
dwAxes
=
0
;
devcaps
.
dwButtons
=
256
;
devcaps
.
dwPOVs
=
0
;
devcaps
.
dwFFSamplePeriod
=
0
;
devcaps
.
dwFFMinTimeResolution
=
0
;
devcaps
.
dwFirmwareRevision
=
100
;
devcaps
.
dwHardwareRevision
=
100
;
devcaps
.
dwFFDriverVersion
=
0
;
memcpy
(
lpDIDevCaps
,
&
devcaps
,
lpDIDevCaps
->
dwSize
);
return
DI_OK
;
}
/******************************************************************************
...
...
dlls/dinput/mouse.c
View file @
6a8ae41c
...
...
@@ -210,7 +210,7 @@ static BOOL mousedev_enum_deviceA(DWORD dwDevType, DWORD dwFlags, LPDIDEVICEINST
if
((
dwDevType
==
0
)
||
((
dwDevType
==
DIDEVTYPE_MOUSE
)
&&
(
version
<
8
))
||
((
dwDevType
==
DI8DEVTYPE_MOUSE
)
&&
(
version
>=
8
)))
{
((
(
dwDevType
==
DI8DEVCLASS_POINTER
)
||
(
dwDevType
==
DI8DEVTYPE_MOUSE
)
)
&&
(
version
>=
8
)))
{
TRACE
(
"Enumerating the mouse device
\n
"
);
fill_mouse_dideviceinstanceA
(
lpddi
,
version
);
...
...
@@ -228,7 +228,7 @@ static BOOL mousedev_enum_deviceW(DWORD dwDevType, DWORD dwFlags, LPDIDEVICEINST
if
((
dwDevType
==
0
)
||
((
dwDevType
==
DIDEVTYPE_MOUSE
)
&&
(
version
<
8
))
||
((
dwDevType
==
DI8DEVTYPE_MOUSE
)
&&
(
version
>=
8
)))
{
((
(
dwDevType
==
DI8DEVCLASS_POINTER
)
||
(
dwDevType
==
DI8DEVTYPE_MOUSE
)
)
&&
(
version
>=
8
)))
{
TRACE
(
"Enumerating the mouse device
\n
"
);
fill_mouse_dideviceinstanceW
(
lpddi
,
version
);
...
...
@@ -923,33 +923,31 @@ static HRESULT WINAPI SysMouseAImpl_GetCapabilities(
LPDIDEVCAPS
lpDIDevCaps
)
{
SysMouseImpl
*
This
=
(
SysMouseImpl
*
)
iface
;
DIDEVCAPS
devcaps
;
TRACE
(
"(this=%p,%p)
\n
"
,
This
,
lpDIDevCaps
);
if
(
lpDIDevCaps
->
dwSize
==
sizeof
(
DIDEVCAPS
))
{
lpDIDevCaps
->
dwFlags
=
DIDC_ATTACHED
;
if
(
This
->
dinput
->
version
>=
8
)
lpDIDevCaps
->
dwDevType
=
DI8DEVTYPE_MOUSE
|
(
DI8DEVTYPEMOUSE_TRADITIONAL
<<
8
);
else
lpDIDevCaps
->
dwDevType
=
DIDEVTYPE_MOUSE
|
(
DIDEVTYPEMOUSE_TRADITIONAL
<<
8
);
lpDIDevCaps
->
dwAxes
=
3
;
lpDIDevCaps
->
dwButtons
=
3
;
lpDIDevCaps
->
dwPOVs
=
0
;
lpDIDevCaps
->
dwFFSamplePeriod
=
0
;
lpDIDevCaps
->
dwFFMinTimeResolution
=
0
;
lpDIDevCaps
->
dwFirmwareRevision
=
100
;
lpDIDevCaps
->
dwHardwareRevision
=
100
;
lpDIDevCaps
->
dwFFDriverVersion
=
0
;
}
else
if
(
lpDIDevCaps
->
dwSize
==
sizeof
(
DIDEVCAPS_DX3
))
{
lpDIDevCaps
->
dwFlags
=
DIDC_ATTACHED
;
lpDIDevCaps
->
dwDevType
=
DIDEVTYPE_MOUSE
|
(
DIDEVTYPEMOUSE_TRADITIONAL
<<
8
);
lpDIDevCaps
->
dwAxes
=
3
;
lpDIDevCaps
->
dwButtons
=
3
;
lpDIDevCaps
->
dwPOVs
=
0
;
}
else
{
if
((
lpDIDevCaps
->
dwSize
!=
sizeof
(
DIDEVCAPS
))
&&
(
lpDIDevCaps
->
dwSize
!=
sizeof
(
DIDEVCAPS_DX3
)))
{
WARN
(
"invalid parameter
\n
"
);
return
DIERR_INVALIDPARAM
;
}
devcaps
.
dwSize
=
lpDIDevCaps
->
dwSize
;
devcaps
.
dwFlags
=
DIDC_ATTACHED
;
if
(
This
->
dinput
->
version
>=
8
)
devcaps
.
dwDevType
=
DI8DEVTYPE_MOUSE
|
(
DI8DEVTYPEMOUSE_TRADITIONAL
<<
8
);
else
devcaps
.
dwDevType
=
DIDEVTYPE_MOUSE
|
(
DIDEVTYPEMOUSE_TRADITIONAL
<<
8
);
devcaps
.
dwAxes
=
3
;
devcaps
.
dwButtons
=
3
;
devcaps
.
dwPOVs
=
0
;
devcaps
.
dwFFSamplePeriod
=
0
;
devcaps
.
dwFFMinTimeResolution
=
0
;
devcaps
.
dwFirmwareRevision
=
100
;
devcaps
.
dwHardwareRevision
=
100
;
devcaps
.
dwFFDriverVersion
=
0
;
memcpy
(
lpDIDevCaps
,
&
devcaps
,
lpDIDevCaps
->
dwSize
);
return
DI_OK
;
}
...
...
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