From 4b33fd691a5028a62d1d5e077bb7224e9d5eec6a Mon Sep 17 00:00:00 2001 From: Vitaliy Margolen Date: Sun, 7 Jan 2007 00:14:56 -0700 Subject: [PATCH] dinput: Set event from queue_event, simplifying code a bit. --- dlls/dinput/device.c | 2 ++ dlls/dinput/keyboard.c | 2 -- dlls/dinput/mouse.c | 3 --- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/dlls/dinput/device.c b/dlls/dinput/device.c index d1efa6df554..34a721d48de 100644 --- a/dlls/dinput/device.c +++ b/dlls/dinput/device.c @@ -591,6 +591,8 @@ void queue_event(LPDIRECTINPUTDEVICE8A iface, int ofs, DWORD data, DWORD time, D This->data_queue[This->queue_head].dwTimeStamp = time; This->data_queue[This->queue_head].dwSequence = seq; This->queue_head = next_pos; + /* Send event if asked */ + if (This->hEvent) SetEvent(This->hEvent); } /****************************************************************************** diff --git a/dlls/dinput/keyboard.c b/dlls/dinput/keyboard.c index 8ca463da9d9..08c6cd8c46f 100644 --- a/dlls/dinput/keyboard.c +++ b/dlls/dinput/keyboard.c @@ -89,8 +89,6 @@ static LRESULT CALLBACK KeyboardCallback( int code, WPARAM wparam, LPARAM lparam EnterCriticalSection(&This->base.crit); queue_event((LPDIRECTINPUTDEVICE8A)This, dik_code, new_diks, hook->time, This->dinput->evsequence++); LeaveCriticalSection(&This->base.crit); - - if (This->base.hEvent) SetEvent(This->base.hEvent); return CallNextHookEx(0, code, wparam, lparam); } diff --git a/dlls/dinput/mouse.c b/dlls/dinput/mouse.c index 2d2ed448300..dc330d9491d 100644 --- a/dlls/dinput/mouse.c +++ b/dlls/dinput/mouse.c @@ -376,9 +376,6 @@ static LRESULT CALLBACK dinput_mouse_hook( int code, WPARAM wparam, LPARAM lpara queue_event((LPDIRECTINPUTDEVICE8A)This, id_to_offset(&This->base.data_format, inst_id), wdata, hook->time, This->dinput->evsequence++); - /* Mouse moved -> send event if asked */ - if (This->base.hEvent) SetEvent(This->base.hEvent); - LeaveCriticalSection(&This->base.crit); /* Ignore message */