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
1db55d25
Commit
1db55d25
authored
Dec 17, 2006
by
Vitaliy Margolen
Committed by
Alexandre Julliard
Dec 18, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput: Don't return non existent keys.
parent
c3b4fe39
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
keyboard.c
dlls/dinput/keyboard.c
+8
-5
No files found.
dlls/dinput/keyboard.c
View file @
1db55d25
...
...
@@ -316,12 +316,13 @@ static HRESULT WINAPI SysKeyboardAImpl_EnumObjects(
memset
(
&
ddoi
,
0
,
sizeof
(
ddoi
));
ddoi
.
dwSize
=
FIELD_OFFSET
(
DIDEVICEOBJECTINSTANCEA
,
dwFFMaxForce
);
for
(
i
=
0
;
i
<
WINE_DINPUT_KEYBOARD_MAX_KEYS
;
i
++
)
{
/* Report 255 keys :-) */
for
(
i
=
0
;
i
<
This
->
base
.
data_format
.
wine_df
->
dwNumObjs
;
i
++
)
{
if
(
!
GetKeyNameTextA
(((
i
&
0x7f
)
<<
16
)
|
((
i
&
0x80
)
<<
17
),
ddoi
.
tszName
,
sizeof
(
ddoi
.
tszName
)))
continue
;
ddoi
.
guidType
=
GUID_Key
;
ddoi
.
dwOfs
=
i
;
ddoi
.
dwType
=
DIDFT_MAKEINSTANCE
(
i
)
|
DIDFT_BUTTON
;
GetKeyNameTextA
(((
i
&
0x7f
)
<<
16
)
|
((
i
&
0x80
)
<<
17
),
ddoi
.
tszName
,
sizeof
(
ddoi
.
tszName
));
_dump_OBJECTINSTANCEA
(
&
ddoi
);
if
(
lpCallback
(
&
ddoi
,
lpvRef
)
!=
DIENUM_CONTINUE
)
return
DI_OK
;
}
...
...
@@ -452,7 +453,8 @@ SysKeyboardAImpl_GetObjectInfo(
ddoi
.
guidType
=
GUID_Key
;
ddoi
.
dwOfs
=
dwObj
;
ddoi
.
dwType
=
DIDFT_MAKEINSTANCE
(
dwObj
)
|
DIDFT_BUTTON
;
GetKeyNameTextA
(((
dwObj
&
0x7f
)
<<
16
)
|
((
dwObj
&
0x80
)
<<
17
),
ddoi
.
tszName
,
sizeof
(
ddoi
.
tszName
));
if
(
!
GetKeyNameTextA
(((
dwObj
&
0x7f
)
<<
16
)
|
((
dwObj
&
0x80
)
<<
17
),
ddoi
.
tszName
,
sizeof
(
ddoi
.
tszName
)))
return
DIERR_OBJECTNOTFOUND
;
/* And return our just filled device object instance structure */
memcpy
(
pdidoi
,
&
ddoi
,
(
dwSize
<
sizeof
(
ddoi
)
?
dwSize
:
sizeof
(
ddoi
)));
...
...
@@ -485,7 +487,8 @@ static HRESULT WINAPI SysKeyboardWImpl_GetObjectInfo(LPDIRECTINPUTDEVICE8W iface
ddoi
.
guidType
=
GUID_Key
;
ddoi
.
dwOfs
=
dwObj
;
ddoi
.
dwType
=
DIDFT_MAKEINSTANCE
(
dwObj
)
|
DIDFT_BUTTON
;
GetKeyNameTextW
(((
dwObj
&
0x7f
)
<<
16
)
|
((
dwObj
&
0x80
)
<<
17
),
ddoi
.
tszName
,
sizeof
(
ddoi
.
tszName
));
if
(
!
GetKeyNameTextW
(((
dwObj
&
0x7f
)
<<
16
)
|
((
dwObj
&
0x80
)
<<
17
),
ddoi
.
tszName
,
sizeof
(
ddoi
.
tszName
)))
return
DIERR_OBJECTNOTFOUND
;
/* And return our just filled device object instance structure */
memcpy
(
pdidoi
,
&
ddoi
,
(
dwSize
<
sizeof
(
ddoi
)
?
dwSize
:
sizeof
(
ddoi
)));
...
...
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