dinput: Set event from queue_event, simplifying code a bit.
This commit is contained in:
parent
8e8b4f03b0
commit
4b33fd691a
|
@ -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);
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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 */
|
||||
|
|
Loading…
Reference in New Issue