r=mkaply, a=blizzard
Part 1: Map WM_CHORD to button 3 click - OS/2 only
This commit is contained in:
mkaply%us.ibm.com 2001-05-18 14:14:00 +00:00
Родитель 0607ee7e44
Коммит 2040ac7450
1 изменённых файлов: 14 добавлений и 3 удалений

Просмотреть файл

@ -1997,7 +1997,20 @@ PRBool nsWindow::ProcessMessage( ULONG msg, MPARAM mp1, MPARAM mp2, MRESULT &rc)
break;
case WM_CHORD:
result = DispatchMouseEvent( 0, mp1, mp2);
{
POINTL ptl;
WinQueryMsgPos( 0/*hab*/, &ptl);
WinMapWindowPoints( HWND_DESKTOP, mWnd, &ptl, 1);
USHORT usFlags = 0;
if (WinIsKeyDown( VK_SHIFT))
usFlags |= KC_SHIFT;
if (WinIsKeyDown( VK_CTRL))
usFlags |= KC_CTRL;
if (WinIsKeyDown( VK_ALT) || WinIsKeyDown( VK_ALTGRAF))
usFlags |= KC_ALT;
result = DispatchMouseEvent( NS_MOUSE_MIDDLE_CLICK, MPFROM2SHORT(ptl.x, ptl.y), MPFROM2SHORT(0,usFlags));
}
break;
case WM_BUTTON3DOWN:
result = DispatchMouseEvent( NS_MOUSE_MIDDLE_BUTTON_DOWN, mp1, mp2);
@ -2310,8 +2323,6 @@ PRBool nsWindow::DispatchMouseEvent( PRUint32 aEventType, MPARAM mp1, MPARAM mp2
}
else
{
if( !aEventType) aEventType = NS_MOUSE_MIDDLE_BUTTON_DOWN; // WM_CHORD hack
InitEvent( event, aEventType, nsnull);
event.isShift = WinIsKeyDown( VK_SHIFT);
event.isControl = WinIsKeyDown( VK_CTRL);