changeset 6438:050af50b4a0e

RT-36132: [Windows] Shift+Scroll Wheel should do horizontal scrolling on Windows Summary: Emulate horizontal scrolling if Shift is pressed
author Anthony Petrov <anthony.petrov@oracle.com>
date Fri, 07 Mar 2014 17:09:31 +0400
parents b2217904cc6a
children 04b694f43543
files modules/graphics/src/main/native-glass/win/ViewContainer.cpp
diffstat 1 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/modules/graphics/src/main/native-glass/win/ViewContainer.cpp	Fri Mar 07 16:45:23 2014 +0400
+++ b/modules/graphics/src/main/native-glass/win/ViewContainer.cpp	Fri Mar 07 17:09:31 2014 +0400
@@ -652,13 +652,17 @@
 
     if (type == com_sun_glass_events_MouseEvent_WHEEL) {
         jdouble dx, dy;
-        if (msg == WM_MOUSEWHEEL) {
-            dx = 0.0;
-            dy = wheelRotation;
-        } else { // WM_MOUSEHWHEEL
+        if (msg == WM_MOUSEHWHEEL) { // native horizontal scroll
             // Negate the value to be more "natural"
             dx = -wheelRotation;
             dy = 0.0;
+        } else if (msg == WM_MOUSEWHEEL && LOWORD(wParam) & MK_SHIFT) {
+            // Do not negate the emulated horizontal scroll amount
+            dx = wheelRotation;
+            dy = 0.0;
+        } else { // vertical scroll
+            dx = 0.0;
+            dy = wheelRotation;
         }
 
         jint ls, cs;