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
61de4e74
Commit
61de4e74
authored
Mar 09, 2006
by
Christoph Frick
Committed by
Alexandre Julliard
Mar 09, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput/linuxinput: Fix handling of DIPH_BYID.
- handling of DIPH_BYID - use regular id and not shifted one also for axes - may only Acquire after SetDataFormat
parent
6b49f6bd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
34 deletions
+19
-34
joystick_linuxinput.c
dlls/dinput/joystick_linuxinput.c
+19
-34
No files found.
dlls/dinput/joystick_linuxinput.c
View file @
61de4e74
...
@@ -466,7 +466,10 @@ static HRESULT WINAPI JoystickAImpl_Acquire(LPDIRECTINPUTDEVICE8A iface)
...
@@ -466,7 +466,10 @@ static HRESULT WINAPI JoystickAImpl_Acquire(LPDIRECTINPUTDEVICE8A iface)
TRACE
(
"(this=%p)
\n
"
,
This
);
TRACE
(
"(this=%p)
\n
"
,
This
);
if
(
This
->
joyfd
!=-
1
)
if
(
This
->
joyfd
!=-
1
)
return
0
;
return
S_FALSE
;
if
(
This
->
df
==
NULL
)
{
return
DIERR_INVALIDPARAM
;
}
for
(
i
=
0
;
i
<
64
;
i
++
)
{
for
(
i
=
0
;
i
<
64
;
i
++
)
{
sprintf
(
buf
,
EVDEVPREFIX
"%d"
,
i
);
sprintf
(
buf
,
EVDEVPREFIX
"%d"
,
i
);
if
(
-
1
==
(
This
->
joyfd
=
open
(
buf
,
O_RDWR
)))
{
if
(
-
1
==
(
This
->
joyfd
=
open
(
buf
,
O_RDWR
)))
{
...
@@ -627,40 +630,22 @@ static void fake_current_js_state(JoystickImpl *ji)
...
@@ -627,40 +630,22 @@ static void fake_current_js_state(JoystickImpl *ji)
static
int
find_property_offset
(
JoystickImpl
*
This
,
LPCDIPROPHEADER
ph
)
static
int
find_property_offset
(
JoystickImpl
*
This
,
LPCDIPROPHEADER
ph
)
{
{
int
i
,
c
;
switch
(
ph
->
dwHow
)
{
switch
(
ph
->
dwHow
)
{
case
DIPH_BYOFFSET
:
case
DIPH_BYOFFSET
:
{
for
(
i
=
0
;
i
<
This
->
df
->
dwNumObjs
;
i
++
)
{
int
i
;
if
(
This
->
df
->
rgodf
[
i
].
dwOfs
==
ph
->
dwObj
)
{
for
(
i
=
0
;
i
<
This
->
df
->
dwNumObjs
;
i
++
)
{
return
i
;
if
(
This
->
df
->
rgodf
[
i
].
dwOfs
==
ph
->
dwObj
)
{
}
return
i
;
}
}
break
;
}
case
DIPH_BYID
:
}
/* XXX: this is a hack - see below */
break
;
c
=
DIDFT_GETINSTANCE
(
ph
->
dwObj
)
>>
WINE_JOYSTICK_AXIS_BASE
;
case
DIPH_BYID
:
{
for
(
i
=
0
;
(
c
&
1
)
==
0
&&
i
<
0x0F
;
i
++
)
{
return
DIDFT_GETINSTANCE
(
ph
->
dwObj
)
>>
WINE_JOYSTICK_AXIS_BASE
;
c
>>=
1
;
}
}
break
;
if
(
i
<
0x0F
)
{
return
i
;
}
/* XXX - the following part won't work with LiveForSpeed
* - the game sets the dwTypes to something else then
* the ddoi.dwType set in EnumObjects
*/
#if 0
for (i=0; i<This->df->dwNumObjs; i++) {
TRACE("dwType='%08x'\n", This->df->rgodf[i].dwType);
if ((This->df->rgodf[i].dwType & 0x00ffffff) == (ph->dwObj & 0x00ffffff)) {
return i;
}
}
#endif
break
;
default:
default:
FIXME
(
"Unhandled ph->dwHow=='%04X'
\n
"
,
(
unsigned
int
)
ph
->
dwHow
);
FIXME
(
"Unhandled ph->dwHow=='%04X'
\n
"
,
(
unsigned
int
)
ph
->
dwHow
);
}
}
return
-
1
;
return
-
1
;
...
@@ -1075,7 +1060,7 @@ static HRESULT WINAPI JoystickAImpl_EnumObjects(
...
@@ -1075,7 +1060,7 @@ static HRESULT WINAPI JoystickAImpl_EnumObjects(
default:
default:
FIXME
(
"unhandled abs axis %d, ignoring!
\n
"
,
i
);
FIXME
(
"unhandled abs axis %d, ignoring!
\n
"
,
i
);
}
}
ddoi
.
dwType
=
DIDFT_MAKEINSTANCE
(
(
1
<<
i
)
<<
WINE_JOYSTICK_AXIS_BASE
)
|
DIDFT_ABSAXIS
;
ddoi
.
dwType
=
DIDFT_MAKEINSTANCE
(
i
<<
WINE_JOYSTICK_AXIS_BASE
)
|
DIDFT_ABSAXIS
;
/* Linux event force feedback supports only (and always) x and y axes */
/* Linux event force feedback supports only (and always) x and y axes */
if
(
i
==
ABS_X
||
i
==
ABS_Y
)
{
if
(
i
==
ABS_X
||
i
==
ABS_Y
)
{
if
(
This
->
has_ff
)
if
(
This
->
has_ff
)
...
...
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