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
36d3aa3d
Commit
36d3aa3d
authored
Jan 26, 2001
by
Ove Kaaven
Committed by
Alexandre Julliard
Jan 26, 2001
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check that the linux 2.4 event interface is available before creating
a dinput device based on it.
parent
8a65170c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
0 deletions
+38
-0
linuxinput.c
dlls/dinput/joystick/linuxinput.c
+38
-0
No files found.
dlls/dinput/joystick/linuxinput.c
View file @
36d3aa3d
...
...
@@ -183,6 +183,44 @@ static JoystickAImpl *alloc_device(REFGUID rguid, ICOM_VTABLE(IDirectInputDevice
static
HRESULT
joydev_create_device
(
IDirectInputAImpl
*
dinput
,
REFGUID
rguid
,
REFIID
riid
,
LPDIRECTINPUTDEVICEA
*
pdev
)
{
int
i
,
fd
,
havejoy
=
0
;
for
(
i
=
0
;
i
<
64
;
i
++
)
{
char
buf
[
200
];
BYTE
absbits
[(
ABS_MAX
+
7
)
/
8
],
keybits
[(
KEY_MAX
+
7
)
/
8
];
sprintf
(
buf
,
EVDEVPREFIX
"%d"
,
i
);
if
(
-
1
!=
(
fd
=
open
(
buf
,
O_RDONLY
)))
{
if
(
-
1
==
ioctl
(
fd
,
EVIOCGBIT
(
EV_ABS
,
sizeof
(
absbits
)),
absbits
))
{
perror
(
"EVIOCGBIT EV_ABS"
);
close
(
fd
);
continue
;
}
if
(
-
1
==
ioctl
(
fd
,
EVIOCGBIT
(
EV_KEY
,
sizeof
(
keybits
)),
keybits
))
{
perror
(
"EVIOCGBIT EV_KEY"
);
close
(
fd
);
continue
;
}
/* A true joystick has at least axis X and Y, and at least 1
* button. copied from linux/drivers/input/joydev.c */
if
(
test_bit
(
absbits
,
ABS_X
)
&&
test_bit
(
absbits
,
ABS_Y
)
&&
(
test_bit
(
keybits
,
BTN_TRIGGER
)
||
test_bit
(
keybits
,
BTN_A
)
||
test_bit
(
keybits
,
BTN_1
)
)
)
{
FIXME
(
"found a joystick at %s!
\n
"
,
buf
);
havejoy
=
1
;
}
close
(
fd
);
}
if
(
havejoy
||
(
errno
==
ENODEV
))
break
;
}
if
(
!
havejoy
)
return
DIERR_DEVICENOTREG
;
if
((
IsEqualGUID
(
&
GUID_Joystick
,
rguid
))
||
(
IsEqualGUID
(
&
DInput_Wine_Joystick_GUID
,
rguid
)))
{
if
((
riid
==
NULL
)
||
(
IsEqualGUID
(
&
IID_IDirectInputDevice2A
,
riid
))
||
(
IsEqualGUID
(
&
IID_IDirectInputDevice2A
,
riid
)))
{
...
...
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