dinput: Consume mouse & keyboard events in exclusive mode.
This commit is contained in:
parent
f35ddbaf68
commit
3743a1a7ca
|
@ -885,6 +885,7 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
|
||||||
static LRESULT CALLBACK LL_hook_proc( int code, WPARAM wparam, LPARAM lparam )
|
static LRESULT CALLBACK LL_hook_proc( int code, WPARAM wparam, LPARAM lparam )
|
||||||
{
|
{
|
||||||
IDirectInputImpl *dinput;
|
IDirectInputImpl *dinput;
|
||||||
|
int skip = 0;
|
||||||
|
|
||||||
if (code != HC_ACTION) return CallNextHookEx( 0, code, wparam, lparam );
|
if (code != HC_ACTION) return CallNextHookEx( 0, code, wparam, lparam );
|
||||||
|
|
||||||
|
@ -899,12 +900,13 @@ static LRESULT CALLBACK LL_hook_proc( int code, WPARAM wparam, LPARAM lparam )
|
||||||
{
|
{
|
||||||
TRACE("calling %p->%p (%lx %lx)\n", dev, dev->event_proc, wparam, lparam);
|
TRACE("calling %p->%p (%lx %lx)\n", dev, dev->event_proc, wparam, lparam);
|
||||||
dev->event_proc( (LPDIRECTINPUTDEVICE8A)dev, wparam, lparam );
|
dev->event_proc( (LPDIRECTINPUTDEVICE8A)dev, wparam, lparam );
|
||||||
|
skip |= dev->dwCoopLevel & DISCL_EXCLUSIVE;
|
||||||
}
|
}
|
||||||
LeaveCriticalSection( &dinput->crit );
|
LeaveCriticalSection( &dinput->crit );
|
||||||
}
|
}
|
||||||
LeaveCriticalSection( &dinput_hook_crit );
|
LeaveCriticalSection( &dinput_hook_crit );
|
||||||
|
|
||||||
return CallNextHookEx( 0, code, wparam, lparam );
|
return skip ? 1 : CallNextHookEx( 0, code, wparam, lparam );
|
||||||
}
|
}
|
||||||
|
|
||||||
static LRESULT CALLBACK callwndproc_proc( int code, WPARAM wparam, LPARAM lparam )
|
static LRESULT CALLBACK callwndproc_proc( int code, WPARAM wparam, LPARAM lparam )
|
||||||
|
|
Loading…
Reference in New Issue