< prev index next >
src/java.desktop/windows/native/libawt/windows/awt_Component.cpp
Print this page
*** 1196,1205 ****
--- 1196,1206 ----
WIN_MSG(WM_MBUTTONUP)
WIN_MSG(WM_MBUTTONDBLCLK)
WIN_MSG(WM_XBUTTONDBLCLK)
WIN_MSG(WM_XBUTTONDOWN)
WIN_MSG(WM_XBUTTONUP)
+ WIN_MSG(WM_MOUSEHWHEEL)
WIN_MSG(WM_MOUSEWHEEL)
WIN_MSG(WM_PARENTNOTIFY)
WIN_MSG(WM_ENTERMENULOOP)
WIN_MSG(WM_EXITMENULOOP)
WIN_MSG(WM_NEXTMENU)
*** 1627,1644 ****
--- 1628,1648 ----
case WM_MBUTTONUP:
case WM_XBUTTONDBLCLK:
case WM_XBUTTONDOWN:
case WM_XBUTTONUP:
case WM_MOUSEMOVE:
+ case WM_MOUSEHWHEEL:
case WM_MOUSEWHEEL:
case WM_AWT_MOUSEENTER:
case WM_AWT_MOUSEEXIT:
curPos = ::GetMessagePos();
POINT myPos;
myPos.x = GET_X_LPARAM(curPos);
myPos.y = GET_Y_LPARAM(curPos);
::ScreenToClient(GetHWnd(), &myPos);
+ BOOL hMouseWheel;
+ hMouseWheel = FALSE;
switch(switchMessage) {
case WM_AWT_MOUSEENTER:
mr = WmMouseEnter(static_cast<UINT>(wParam), myPos.x, myPos.y);
break;
case WM_LBUTTONDOWN:
*** 1697,1710 ****
MIDDLE_BUTTON);
break;
case WM_AWT_MOUSEEXIT:
mr = WmMouseExit(static_cast<UINT>(wParam), myPos.x, myPos.y);
break;
case WM_MOUSEWHEEL:
mr = WmMouseWheel(GET_KEYSTATE_WPARAM(wParam),
GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam),
! GET_WHEEL_DELTA_WPARAM(wParam));
break;
}
break;
case WM_SETCURSOR:
mr = mrDoDefault;
--- 1701,1716 ----
MIDDLE_BUTTON);
break;
case WM_AWT_MOUSEEXIT:
mr = WmMouseExit(static_cast<UINT>(wParam), myPos.x, myPos.y);
break;
+ case WM_MOUSEHWHEEL:
+ hMouseWheel = TRUE;
case WM_MOUSEWHEEL:
mr = WmMouseWheel(GET_KEYSTATE_WPARAM(wParam),
GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam),
! GET_WHEEL_DELTA_WPARAM(wParam), hMouseWheel);
break;
}
break;
case WM_SETCURSOR:
mr = mrDoDefault;
*** 2447,2457 ****
sm_cursorOn = NULL;
return mrConsume; /* Don't pass our synthetic event on! */
}
MsgRouting AwtComponent::WmMouseWheel(UINT flags, int x, int y,
! int wheelRotation)
{
// convert coordinates to be Component-relative, not screen relative
// for wheeling when outside the window, this works similar to
// coordinates during a drag
POINT eventPt;
--- 2453,2463 ----
sm_cursorOn = NULL;
return mrConsume; /* Don't pass our synthetic event on! */
}
MsgRouting AwtComponent::WmMouseWheel(UINT flags, int x, int y,
! int wheelRotation, BOOL hMouseWheel)
{
// convert coordinates to be Component-relative, not screen relative
// for wheeling when outside the window, this works similar to
// coordinates during a drag
POINT eventPt;
*** 2492,2503 ****
}
}
DTRACE_PRINTLN("calling SendMouseWheelEvent");
SendMouseWheelEvent(java_awt_event_MouseEvent_MOUSE_WHEEL, ::JVM_CurrentTimeMillis(NULL, 0),
! eventPt.x, eventPt.y, GetJavaModifiers(), 0, 0, scrollType,
scrollLines, roundedWheelRotation, preciseWheelRotation, &msg);
m_wheelRotationAmount %= WHEEL_DELTA;
// this message could be propagated up to the parent chain
// by the mouse message post processors
--- 2498,2513 ----
}
}
DTRACE_PRINTLN("calling SendMouseWheelEvent");
+ jint modifiers = GetJavaModifiers();
+ if (hMouseWheel) {
+ modifiers |= java_awt_event_InputEvent_SHIFT_DOWN_MASK;
+ }
SendMouseWheelEvent(java_awt_event_MouseEvent_MOUSE_WHEEL, ::JVM_CurrentTimeMillis(NULL, 0),
! eventPt.x, eventPt.y, modifiers, 0, 0, scrollType,
scrollLines, roundedWheelRotation, preciseWheelRotation, &msg);
m_wheelRotationAmount %= WHEEL_DELTA;
// this message could be propagated up to the parent chain
// by the mouse message post processors
< prev index next >