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
b9e8284a
Commit
b9e8284a
authored
Jun 28, 2007
by
Vitaliy Margolen
Committed by
Alexandre Julliard
Jun 29, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput: Move key state array into object.
parent
4727bec5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
9 deletions
+7
-9
keyboard.c
dlls/dinput/keyboard.c
+7
-9
No files found.
dlls/dinput/keyboard.c
View file @
b9e8284a
...
...
@@ -47,6 +47,7 @@ typedef struct SysKeyboardImpl SysKeyboardImpl;
struct
SysKeyboardImpl
{
struct
IDirectInputDevice2AImpl
base
;
BYTE
DInputKeyState
[
WINE_DINPUT_KEYBOARD_MAX_KEYS
];
};
static
SysKeyboardImpl
*
current_lock
=
NULL
;
...
...
@@ -57,8 +58,6 @@ static SysKeyboardImpl* current_lock = NULL;
* but 'DI_LOSTFOCUS' and 'DI_UNACQUIRED' exist for a reason.
*/
static
BYTE
DInputKeyState
[
WINE_DINPUT_KEYBOARD_MAX_KEYS
];
/* array for 'GetDeviceState' */
static
LRESULT
CALLBACK
KeyboardCallback
(
int
code
,
WPARAM
wparam
,
LPARAM
lparam
)
{
SysKeyboardImpl
*
This
=
(
SysKeyboardImpl
*
)
current_lock
;
...
...
@@ -77,11 +76,11 @@ static LRESULT CALLBACK KeyboardCallback( int code, WPARAM wparam, LPARAM lparam
new_diks
=
hook
->
flags
&
LLKHF_UP
?
0
:
0x80
;
/* returns now if key event already known */
if
(
new_diks
==
DInputKeyState
[
dik_code
])
if
(
new_diks
==
This
->
DInputKeyState
[
dik_code
])
return
CallNextHookEx
(
0
,
code
,
wparam
,
lparam
);
DInputKeyState
[
dik_code
]
=
new_diks
;
TRACE
(
" setting %02X to %02X
\n
"
,
dik_code
,
DInputKeyState
[
dik_code
]);
This
->
DInputKeyState
[
dik_code
]
=
new_diks
;
TRACE
(
" setting %02X to %02X
\n
"
,
dik_code
,
This
->
DInputKeyState
[
dik_code
]);
dik_code
=
id_to_offset
(
&
This
->
base
.
data_format
,
DIDFT_MAKEINSTANCE
(
dik_code
)
|
DIDFT_PSHBUTTON
);
EnterCriticalSection
(
&
This
->
base
.
crit
);
...
...
@@ -288,13 +287,12 @@ static HRESULT WINAPI SysKeyboardAImpl_GetDeviceState(
if
(
TRACE_ON
(
dinput
))
{
int
i
;
for
(
i
=
0
;
i
<
WINE_DINPUT_KEYBOARD_MAX_KEYS
;
i
++
)
{
if
(
DInputKeyState
[
i
]
!=
0x00
)
{
TRACE
(
" - %02X: %02x
\n
"
,
i
,
DInputKeyState
[
i
]);
}
if
(
This
->
DInputKeyState
[
i
]
!=
0x00
)
TRACE
(
" - %02X: %02x
\n
"
,
i
,
This
->
DInputKeyState
[
i
]);
}
}
memcpy
(
ptr
,
DInputKeyState
,
WINE_DINPUT_KEYBOARD_MAX_KEYS
);
memcpy
(
ptr
,
This
->
DInputKeyState
,
WINE_DINPUT_KEYBOARD_MAX_KEYS
);
LeaveCriticalSection
(
&
This
->
base
.
crit
);
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