Commit 4b33fd69 authored by Vitaliy Margolen's avatar Vitaliy Margolen Committed by Alexandre Julliard

dinput: Set event from queue_event, simplifying code a bit.

parent 8e8b4f03
...@@ -591,6 +591,8 @@ void queue_event(LPDIRECTINPUTDEVICE8A iface, int ofs, DWORD data, DWORD time, D ...@@ -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].dwTimeStamp = time;
This->data_queue[This->queue_head].dwSequence = seq; This->data_queue[This->queue_head].dwSequence = seq;
This->queue_head = next_pos; This->queue_head = next_pos;
/* Send event if asked */
if (This->hEvent) SetEvent(This->hEvent);
} }
/****************************************************************************** /******************************************************************************
......
...@@ -89,8 +89,6 @@ static LRESULT CALLBACK KeyboardCallback( int code, WPARAM wparam, LPARAM lparam ...@@ -89,8 +89,6 @@ static LRESULT CALLBACK KeyboardCallback( int code, WPARAM wparam, LPARAM lparam
EnterCriticalSection(&This->base.crit); EnterCriticalSection(&This->base.crit);
queue_event((LPDIRECTINPUTDEVICE8A)This, dik_code, new_diks, hook->time, This->dinput->evsequence++); queue_event((LPDIRECTINPUTDEVICE8A)This, dik_code, new_diks, hook->time, This->dinput->evsequence++);
LeaveCriticalSection(&This->base.crit); LeaveCriticalSection(&This->base.crit);
if (This->base.hEvent) SetEvent(This->base.hEvent);
return CallNextHookEx(0, code, wparam, lparam); return CallNextHookEx(0, code, wparam, lparam);
} }
......
...@@ -376,9 +376,6 @@ static LRESULT CALLBACK dinput_mouse_hook( int code, WPARAM wparam, LPARAM lpara ...@@ -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), queue_event((LPDIRECTINPUTDEVICE8A)This, id_to_offset(&This->base.data_format, inst_id),
wdata, hook->time, This->dinput->evsequence++); wdata, hook->time, This->dinput->evsequence++);
/* Mouse moved -> send event if asked */
if (This->base.hEvent) SetEvent(This->base.hEvent);
LeaveCriticalSection(&This->base.crit); LeaveCriticalSection(&This->base.crit);
/* Ignore message */ /* Ignore message */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment