Bugfix #28109
authorTon Roosendaal <ton@blender.org>
Sat, 30 Jul 2011 10:14:50 +0000 (10:14 +0000)
committerTon Roosendaal <ton@blender.org>
Sat, 30 Jul 2011 10:14:50 +0000 (10:14 +0000)
Old issue with OSX Cocoa code: shift+scrollwheel should send
a 'horizontal wheel' event to Blender. Blender only recognizes
scroll events in general though. The old code then just didn't
send an event at all, not passing on shift+scrolls.

Now the scroll event is sent anyway, relying on Blender's
keymapping to define what to do with shift+scroll.

This fixes things like shift+scroll to scale ListBox widgets.

intern/ghost/intern/GHOST_SystemCocoa.mm

index bb3d6e3aee331257e563f01162a1c68b43348faf..5c88523d4063220eb15501c4392024fa589272c7 100644 (file)
@@ -1560,6 +1560,8 @@ GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr)
                                        GHOST_TInt32 delta;
                                        
                                        double deltaF = [event deltaY];
                                        GHOST_TInt32 delta;
                                        
                                        double deltaF = [event deltaY];
+
+                                       if (deltaF == 0.0) deltaF = [event deltaX]; // make blender decide if it's horizontal scroll
                                        if (deltaF == 0.0) break; //discard trackpad delta=0 events
                                        
                                        delta = deltaF > 0.0 ? 1 : -1;
                                        if (deltaF == 0.0) break; //discard trackpad delta=0 events
                                        
                                        delta = deltaF > 0.0 ? 1 : -1;