Skip to content
Snippets Groups Projects
Commit 84ee125f authored by Francis Beaudet's avatar Francis Beaudet Committed by Alexandre Julliard
Browse files

Make sure that the keystate received by the WM_XBUTTONUP and

WM_XBUTTONDOWN matches the message. In X, the keystate is changed
after the message is processed.  In Windows, it is changed before.
parent 6d594456
Branches
Tags
No related merge requests found
......@@ -695,12 +695,35 @@ static void EVENT_ButtonPress( WND *pWnd, XButtonEvent *event )
int xOffset = pWnd? pWnd->rectWindow.left : 0;
int yOffset = pWnd? pWnd->rectWindow.top : 0;
WORD keystate;
if (buttonNum >= NB_BUTTONS) return;
/*
* Get the compatible keystate
*/
keystate = EVENT_XStateToKeyState( event->state );
/*
* Make sure that the state of the button that was just
* pressed is "down".
*/
switch (buttonNum)
{
case 0:
keystate |= MK_LBUTTON;
break;
case 1:
keystate |= MK_MBUTTON;
break;
case 2:
keystate |= MK_RBUTTON;
break;
}
MOUSE_SendEvent( statusCodes[buttonNum],
xOffset + event->x, yOffset + event->y,
EVENT_XStateToKeyState( event->state ),
keystate,
event->time - MSG_WineStartTicks,
pWnd? pWnd->hwndSelf : 0 );
}
......@@ -717,12 +740,35 @@ static void EVENT_ButtonRelease( WND *pWnd, XButtonEvent *event )
int xOffset = pWnd? pWnd->rectWindow.left : 0;
int yOffset = pWnd? pWnd->rectWindow.top : 0;
WORD keystate;
if (buttonNum >= NB_BUTTONS) return;
/*
* Get the compatible keystate
*/
keystate = EVENT_XStateToKeyState( event->state );
/*
* Make sure that the state of the button that was just
* released is "up".
*/
switch (buttonNum)
{
case 0:
keystate &= ~MK_LBUTTON;
break;
case 1:
keystate &= ~MK_MBUTTON;
break;
case 2:
keystate &= ~MK_RBUTTON;
break;
}
MOUSE_SendEvent( statusCodes[buttonNum],
xOffset + event->x, yOffset + event->y,
EVENT_XStateToKeyState( event->state ),
keystate,
event->time - MSG_WineStartTicks,
pWnd? pWnd->hwndSelf : 0 );
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment