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
74f2eccc
Commit
74f2eccc
authored
Feb 21, 2009
by
Vitaliy Margolen
Committed by
Alexandre Julliard
Feb 23, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput: Let each device decide which hook event to skip.
Some programs acquire mouse in exclusive and keyboard in non-exclusive mode.
parent
6f73f1bd
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
10 deletions
+15
-10
dinput_main.c
dlls/dinput/dinput_main.c
+1
-2
dinput_private.h
dlls/dinput/dinput_private.h
+1
-1
keyboard.c
dlls/dinput/keyboard.c
+6
-4
mouse.c
dlls/dinput/mouse.c
+7
-3
No files found.
dlls/dinput/dinput_main.c
View file @
74f2eccc
...
...
@@ -899,8 +899,7 @@ static LRESULT CALLBACK LL_hook_proc( int code, WPARAM wparam, LPARAM lparam )
if
(
dev
->
acquired
&&
dev
->
event_proc
)
{
TRACE
(
"calling %p->%p (%lx %lx)
\n
"
,
dev
,
dev
->
event_proc
,
wparam
,
lparam
);
dev
->
event_proc
(
(
LPDIRECTINPUTDEVICE8A
)
dev
,
wparam
,
lparam
);
skip
|=
dev
->
dwCoopLevel
&
DISCL_EXCLUSIVE
;
skip
|=
dev
->
event_proc
(
(
LPDIRECTINPUTDEVICE8A
)
dev
,
wparam
,
lparam
);
}
LeaveCriticalSection
(
&
dinput
->
crit
);
}
...
...
dlls/dinput/dinput_private.h
View file @
74f2eccc
...
...
@@ -60,7 +60,7 @@ extern const struct dinput_device joystick_linux_device;
extern
const
struct
dinput_device
joystick_linuxinput_device
;
extern
void
check_dinput_hooks
(
LPDIRECTINPUTDEVICE8A
);
typedef
void
(
*
DI_EVENT_PROC
)(
LPDIRECTINPUTDEVICE8A
,
WPARAM
,
LPARAM
);
typedef
int
(
*
DI_EVENT_PROC
)(
LPDIRECTINPUTDEVICE8A
,
WPARAM
,
LPARAM
);
extern
void
_dump_diactionformatA
(
LPDIACTIONFORMATA
);
...
...
dlls/dinput/keyboard.c
View file @
74f2eccc
...
...
@@ -74,16 +74,16 @@ static BYTE map_dik_code(DWORD scanCode, DWORD vkCode)
return
out_code
;
}
static
void
KeyboardCallback
(
LPDIRECTINPUTDEVICE8A
iface
,
WPARAM
wparam
,
LPARAM
lparam
)
static
int
KeyboardCallback
(
LPDIRECTINPUTDEVICE8A
iface
,
WPARAM
wparam
,
LPARAM
lparam
)
{
SysKeyboardImpl
*
This
=
(
SysKeyboardImpl
*
)
iface
;
int
dik_code
;
int
dik_code
,
ret
=
This
->
base
.
dwCoopLevel
&
DISCL_EXCLUSIVE
;
KBDLLHOOKSTRUCT
*
hook
=
(
KBDLLHOOKSTRUCT
*
)
lparam
;
BYTE
new_diks
;
if
(
wparam
!=
WM_KEYDOWN
&&
wparam
!=
WM_KEYUP
&&
wparam
!=
WM_SYSKEYDOWN
&&
wparam
!=
WM_SYSKEYUP
)
return
;
return
0
;
TRACE
(
"(%p) %ld,%ld
\n
"
,
iface
,
wparam
,
lparam
);
...
...
@@ -96,7 +96,7 @@ static void KeyboardCallback( LPDIRECTINPUTDEVICE8A iface, WPARAM wparam, LPARAM
/* returns now if key event already known */
if
(
new_diks
==
This
->
DInputKeyState
[
dik_code
])
return
;
return
ret
;
This
->
DInputKeyState
[
dik_code
]
=
new_diks
;
TRACE
(
" setting %02X to %02X
\n
"
,
dik_code
,
This
->
DInputKeyState
[
dik_code
]);
...
...
@@ -105,6 +105,8 @@ static void KeyboardCallback( LPDIRECTINPUTDEVICE8A iface, WPARAM wparam, LPARAM
EnterCriticalSection
(
&
This
->
base
.
crit
);
queue_event
((
LPDIRECTINPUTDEVICE8A
)
This
,
dik_code
,
new_diks
,
hook
->
time
,
This
->
base
.
dinput
->
evsequence
++
);
LeaveCriticalSection
(
&
This
->
base
.
crit
);
return
ret
;
}
const
GUID
DInput_Wine_Keyboard_GUID
=
{
/* 0ab8648a-7735-11d2-8c73-71df54a96441 */
...
...
dlls/dinput/mouse.c
View file @
74f2eccc
...
...
@@ -78,7 +78,7 @@ struct SysMouseImpl
WARP_MOUSE
warp_override
;
};
static
void
dinput_mouse_hook
(
LPDIRECTINPUTDEVICE8A
iface
,
WPARAM
wparam
,
LPARAM
lparam
);
static
int
dinput_mouse_hook
(
LPDIRECTINPUTDEVICE8A
iface
,
WPARAM
wparam
,
LPARAM
lparam
);
const
GUID
DInput_Wine_Mouse_GUID
=
{
/* 9e573ed8-7734-11d2-8d4a-23903fb6bdf7 */
0x9e573ed8
,
0x7734
,
0x11d2
,
{
0x8d
,
0x4a
,
0x23
,
0x90
,
0x3f
,
0xb6
,
0xbd
,
0xf7
}
...
...
@@ -286,17 +286,18 @@ const struct dinput_device mouse_device = {
*/
/* low-level mouse hook */
static
void
dinput_mouse_hook
(
LPDIRECTINPUTDEVICE8A
iface
,
WPARAM
wparam
,
LPARAM
lparam
)
static
int
dinput_mouse_hook
(
LPDIRECTINPUTDEVICE8A
iface
,
WPARAM
wparam
,
LPARAM
lparam
)
{
MSLLHOOKSTRUCT
*
hook
=
(
MSLLHOOKSTRUCT
*
)
lparam
;
SysMouseImpl
*
This
=
(
SysMouseImpl
*
)
iface
;
DWORD
dwCoop
;
int
wdata
=
0
,
inst_id
=
-
1
;
int
wdata
=
0
,
inst_id
=
-
1
,
ret
;
TRACE
(
"msg %lx @ (%d %d)
\n
"
,
wparam
,
hook
->
pt
.
x
,
hook
->
pt
.
y
);
EnterCriticalSection
(
&
This
->
base
.
crit
);
dwCoop
=
This
->
base
.
dwCoopLevel
;
ret
=
dwCoop
&
DISCL_EXCLUSIVE
;
switch
(
wparam
)
{
case
WM_MOUSEMOVE
:
...
...
@@ -370,6 +371,8 @@ static void dinput_mouse_hook( LPDIRECTINPUTDEVICE8A iface, WPARAM wparam, LPARA
inst_id
=
DIDFT_MAKEINSTANCE
(
WINE_MOUSE_BUTTONS_INSTANCE
+
2
+
HIWORD
(
hook
->
mouseData
))
|
DIDFT_PSHBUTTON
;
This
->
m_state
.
rgbButtons
[
2
+
HIWORD
(
hook
->
mouseData
)]
=
wdata
=
0x00
;
break
;
default:
ret
=
0
;
}
...
...
@@ -381,6 +384,7 @@ static void dinput_mouse_hook( LPDIRECTINPUTDEVICE8A iface, WPARAM wparam, LPARA
}
LeaveCriticalSection
(
&
This
->
base
.
crit
);
return
ret
;
}
static
BOOL
dinput_window_check
(
SysMouseImpl
*
This
)
{
...
...
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