Mouse events fix.

This commit is contained in:
Andreas Mohr 2001-01-05 22:15:20 +00:00 committed by Alexandre Julliard
parent 8081e5a1e5
commit abade021fe
1 changed files with 11 additions and 5 deletions

View File

@ -108,6 +108,7 @@ struct SysMouseAImpl
LONG prevX, prevY; LONG prevX, prevY;
LPMOUSE_EVENT_PROC prev_handler; LPMOUSE_EVENT_PROC prev_handler;
HWND win; HWND win;
DWORD dwCoopLevel;
DWORD win_centerX, win_centerY; DWORD win_centerX, win_centerY;
LPDIDEVICEOBJECTDATA data_queue; LPDIDEVICEOBJECTDATA data_queue;
int queue_pos, queue_len; int queue_pos, queue_len;
@ -259,6 +260,7 @@ static HRESULT WINAPI SysMouseAImpl_SetCooperativeLevel(
/* Store the window which asks for the mouse */ /* Store the window which asks for the mouse */
This->win = hwnd; This->win = hwnd;
This->dwCoopLevel = dwflags;
return 0; return 0;
} }
@ -350,8 +352,7 @@ static void WINAPI dinput_mouse_event( DWORD dwFlags, DWORD dx, DWORD dy,
(posX == This->win_centerX) && (posX == This->win_centerX)) { (posX == This->win_centerX) && (posX == This->win_centerX)) {
/* Warp has been done... */ /* Warp has been done... */
This->need_warp = WARP_DONE; This->need_warp = WARP_DONE;
LeaveCriticalSection(&(This->crit)); goto end;
return;
} }
/* Relative mouse input with absolute mouse event : the real fun starts here... */ /* Relative mouse input with absolute mouse event : the real fun starts here... */
@ -426,8 +427,7 @@ static void WINAPI dinput_mouse_event( DWORD dwFlags, DWORD dx, DWORD dy,
} }
} else { } else {
ERR("Mouse event not supported...\n"); ERR("Mouse event not supported...\n");
LeaveCriticalSection(&(This->crit)); goto end;
return ;
} }
if (TRACE_ON(dinput)) { if (TRACE_ON(dinput)) {
@ -479,6 +479,12 @@ static void WINAPI dinput_mouse_event( DWORD dwFlags, DWORD dx, DWORD dy,
This->m_state.lX, This->m_state.lY, This->m_state.lX, This->m_state.lY,
This->m_state.rgbButtons[0], This->m_state.rgbButtons[2], This->m_state.rgbButtons[1]); This->m_state.rgbButtons[0], This->m_state.rgbButtons[2], This->m_state.rgbButtons[1]);
end:
if (This->dwCoopLevel & DISCL_NONEXCLUSIVE)
{ /* pass the events down to previous handlers (e.g. win32 input) */
if (This->prev_handler)
This->prev_handler(dwFlags, dx, dy, cButtons, dwExtraInfo);
}
LeaveCriticalSection(&(This->crit)); LeaveCriticalSection(&(This->crit));
} }