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
0bd249dd
Commit
0bd249dd
authored
May 07, 2002
by
Olivier Houchard
Committed by
Alexandre Julliard
May 07, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hack to make SetEventNotification work.
parent
b462a044
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
3 deletions
+28
-3
main.c
dlls/dinput/keyboard/main.c
+28
-3
No files found.
dlls/dinput/keyboard/main.c
View file @
0bd249dd
...
...
@@ -37,7 +37,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(dinput);
static
ICOM_VTABLE
(
IDirectInputDevice2A
)
SysKeyboardAvt
;
static
ICOM_VTABLE
(
IDirectInputDevice7A
)
SysKeyboard7Avt
;
typedef
struct
SysKeyboardAImpl
SysKeyboardAImpl
;
struct
SysKeyboardAImpl
{
...
...
@@ -48,11 +48,15 @@ struct SysKeyboardAImpl
IDirectInputAImpl
*
dinput
;
HANDLE
hEvent
;
HHOOK
hook
;
/* SysKeyboardAImpl */
BYTE
keystate
[
256
];
int
acquired
;
};
static
SysKeyboardAImpl
*
current_lock
=
NULL
;
static
GUID
DInput_Wine_Keyboard_GUID
=
{
/* 0ab8648a-7735-11d2-8c73-71df54a96441 */
0x0ab8648a
,
0x7735
,
...
...
@@ -205,6 +209,14 @@ static HRESULT WINAPI SysKeyboardAImpl_GetDeviceData(
return
DI_OK
;
}
static
LRESULT
CALLBACK
dinput_keyboard_hook
(
int
code
,
WPARAM
wparam
,
LPARAM
lparam
)
{
SysKeyboardAImpl
*
This
=
current_lock
;
if
(
This
&&
This
->
hEvent
)
SetEvent
(
This
->
hEvent
);
return
1
;
}
static
HRESULT
WINAPI
SysKeyboardAImpl_Acquire
(
LPDIRECTINPUTDEVICE2A
iface
)
{
ICOM_THIS
(
SysKeyboardAImpl
,
iface
);
...
...
@@ -215,6 +227,7 @@ static HRESULT WINAPI SysKeyboardAImpl_Acquire(LPDIRECTINPUTDEVICE2A iface)
This
->
acquired
=
1
;
}
This
->
hook
=
SetWindowsHookExW
(
WH_KEYBOARD
,
dinput_keyboard_hook
,
0
,
0
);
return
DI_OK
;
}
...
...
@@ -225,6 +238,7 @@ static HRESULT WINAPI SysKeyboardAImpl_Unacquire(LPDIRECTINPUTDEVICE2A iface)
if
(
This
->
acquired
==
1
)
{
This
->
acquired
=
0
;
UnhookWindowsHookEx
(
This
->
hook
);
}
else
{
ERR
(
"Unacquiring a not-acquired device !!!
\n
"
);
}
...
...
@@ -235,6 +249,17 @@ static HRESULT WINAPI SysKeyboardAImpl_Unacquire(LPDIRECTINPUTDEVICE2A iface)
/******************************************************************************
* GetCapabilities : get the device capablitites
*/
static
HRESULT
WINAPI
SysKeyboardAImpl_SetEventNotification
(
LPDIRECTINPUTDEVICE2A
iface
,
HANDLE
hnd
)
{
ICOM_THIS
(
SysKeyboardAImpl
,
iface
);
TRACE
(
"(this=%p,0x%08lx)
\n
"
,
This
,(
DWORD
)
hnd
);
This
->
hEvent
=
hnd
;
current_lock
=
This
;
return
DI_OK
;
}
static
HRESULT
WINAPI
SysKeyboardAImpl_GetCapabilities
(
LPDIRECTINPUTDEVICE2A
iface
,
LPDIDEVCAPS
lpDIDevCaps
)
...
...
@@ -277,7 +302,7 @@ static ICOM_VTABLE(IDirectInputDevice2A) SysKeyboardAvt =
SysKeyboardAImpl_GetDeviceState
,
SysKeyboardAImpl_GetDeviceData
,
IDirectInputDevice2AImpl_SetDataFormat
,
IDirectInputDevice2
AImpl_SetEventNotification
,
SysKeyboard
AImpl_SetEventNotification
,
IDirectInputDevice2AImpl_SetCooperativeLevel
,
IDirectInputDevice2AImpl_GetObjectInfo
,
IDirectInputDevice2AImpl_GetDeviceInfo
,
...
...
@@ -315,7 +340,7 @@ static ICOM_VTABLE(IDirectInputDevice7A) SysKeyboard7Avt =
XCAST
(
GetDeviceState
)
SysKeyboardAImpl_GetDeviceState
,
XCAST
(
GetDeviceData
)
SysKeyboardAImpl_GetDeviceData
,
XCAST
(
SetDataFormat
)
IDirectInputDevice2AImpl_SetDataFormat
,
XCAST
(
SetEventNotification
)
IDirectInputDevice2
AImpl_SetEventNotification
,
XCAST
(
SetEventNotification
)
SysKeyboard
AImpl_SetEventNotification
,
XCAST
(
SetCooperativeLevel
)
IDirectInputDevice2AImpl_SetCooperativeLevel
,
XCAST
(
GetObjectInfo
)
IDirectInputDevice2AImpl_GetObjectInfo
,
XCAST
(
GetDeviceInfo
)
IDirectInputDevice2AImpl_GetDeviceInfo
,
...
...
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