Home

Zooming with MagicMouse doesn't work in Lion
Closed, InvalidPublic

Description
Since I updated to OS X Lion (10.7), I can't zoom properly with the Magic Mouse anymore. When I swipe my finger up and down, only the view moves up and down (same for horizontal). Only when swiping my finger fast up and down, blender starts to zoom in 3D View.

Other have this problem too:
http://blenderartists.org/forum/showthread.php?225619-Blender-2.5-zooming-doesn-t-work-when-using-os-x-lion-with-magic-mouse
http://www.blender.org/forum/viewtopic.php?p=88479&sid=516545b1a623e8060c2f3ad5ac12d753

Testet with: Blender 2.58a, latest Tomato Branch Revision.
markus-k (Markus Kasten) set Type to Bug.Via Old WorldJul 26 2011, 5:29 PM
brecht (Brecht Van Lommel) added a comment.Via Old WorldJul 28 2011, 5:20 PM
Are you testing this on a MacBook? We seem to have some code that attempts to interpret scroll events from trackpads differently, perhaps it gets confused when using the magic mouse with a laptop that also has a trackpad.

I don't have OS X 10.7 nor a Magic Mouse to test, so assigning to Damien.
markus-k (Markus Kasten) added a comment.Via Old WorldJul 28 2011, 8:56 PM
Yes, I'm using a MacBook Pro 2010 with TrackPad and MagicMouse.
ton (Ton Roosendaal) added a comment.Via Old WorldJul 29 2011, 6:54 PM
Issue has been mentioned a lot already, we need someone with 10.7 and that mouse to check what changed in Cocoa for it...
markus-k (Markus Kasten) added a comment.Via Old WorldJul 29 2011, 9:22 PM
Ok, I was working on this issue for an hour, I think I was able to fix it. But it should be tested by someone not running 10.7 Lion on a Mac with a Trackpad.
I've attached a patch, hope it works on other machines (without Lion) too.
Here is the patch.
ton (Ton Roosendaal) added a comment.Via Old WorldJul 30 2011, 12:41 PM
Hi,

Today I fixed, with a 1-liner in code, shift+scrollwheel in Cocoa (10.5, 10.6 works now).
The diff you provide would rule this fix out again... and I'm very much unsure how your patch would work for scrollwheels and trackpads.
w1sm3rhi11 (Alexandre Levy) added a comment.Via Old WorldAug 12 2011, 11:15 PM
Hello,

I planned to test this patch on 38821 release and I would like to know if this patch has a chance to be integrated on future releases of Blender.
Moreover if I test it on 38821 release, which release should I use for lib ?

Thanks in advance for your reply.
markus-k (Markus Kasten) added a comment.Via Old WorldAug 13 2011, 12:09 AM
Hello,

Well, after a bit of playing with blender after applying this patch I recognized, that I can't pan around the view with two fingers anymore, what the code I was removing has done. There should be a better way to detect, if the user is scrolling with his (magic) mouse or he is using the trackpad to pan around, than removing a feature.
ton (Ton Roosendaal) added a comment.Via Old WorldAug 21 2011, 2:22 PM
The patch Is for me doing things I can't justify really.
Please download the 2.59 version from blender.org and test it, report back what specifically fails, then Jens checks on it.
rectalogic (Andrew Wason) added a comment.Via Old WorldOct 10 2011, 5:20 AM
I built blender svn r40855 and added some debugger logging. I don't see a way to distinguish two-finger drag on the trackpad (which pans) from single finger swipe up and down on the magic mouse under Lion. Both result in NSEventTypeBeginGesture followed by a bunch of NSScrollWheel then NSEventTypeEndGesture. So the m_isGestureInProgress flag is no longer enough to distinguish trackpad from magic mouse.

Here is the log from single finger swiping on magic mouse (many NSScrollWheels deleted) - this is just doing "po event" in the debugger on every NSEvent:

NSEvent: type=BeginGesture loc=(771.414,560.348) time=294741.2 flags=0x100 win=0x10363cda0 winNum=6052 ctxt=0x0 subtype=6
NSEvent: type=ScrollWheel loc=(771,561) time=294741.2 flags=0x100 win=0x10363cda0 winNum=6052 ctxt=0x0 deltaX=0.000000 deltaY=-0.865906 deltaZ=0.000000 deviceDeltaX=0.000000 deviceDeltaY=-8.000000 deviceDeltaZ=0.000000 phase=Began momentumPhase=None
NSEvent: type=ScrollWheel loc=(771,561) time=294741.2 flags=0x100 win=0x10363cda0 winNum=6052 ctxt=0x0 deltaX=0.000000 deltaY=-1.336609 deltaZ=0.000000 deviceDeltaX=0.000000 deviceDeltaY=-13.000000 deviceDeltaZ=0.000000 phase=Changed momentumPhase=None
NSEvent: type=ScrollWheel loc=(771,561) time=294741.2 flags=0x100 win=0x10363cda0 winNum=6052 ctxt=0x0 deltaX=0.000000 deltaY=-3.547546 deltaZ=0.000000 deviceDeltaX=0.000000 deviceDeltaY=-35.000000 deviceDeltaZ=0.000000 phase=Changed momentumPhase=None
[...]
NSEvent: type=ScrollWheel loc=(771,561) time=294741.5 flags=0x100 win=0x10363cda0 winNum=6052 ctxt=0x0 deltaX=0.000000 deltaY=0.000000 deltaZ=0.000000 deviceDeltaX=0.000000 deviceDeltaY=-3.000000 deviceDeltaZ=0.000000 phase=Changed momentumPhase=None
NSEvent: type=EndGesture loc=(771.414,560.348) time=294741.5 flags=0x100 win=0x10363cda0 winNum=6052 ctxt=0x0 subtype=6

And here is the log from two-finger swiping on the trackpad:

NSEvent: type=BeginGesture loc=(847.008,493.305) time=295067.8 flags=0x100 win=0x10363cda0 winNum=6052 ctxt=0x0 subtype=6
NSEvent: type=ScrollWheel loc=(847,494) time=295067.9 flags=0x100 win=0x10363cda0 winNum=6052 ctxt=0x0 deltaX=0.000000 deltaY=0.000000 deltaZ=0.000000 deviceDeltaX=0.000000 deviceDeltaY=1.000000 deviceDeltaZ=0.000000 phase=Began momentumPhase=None
NSEvent: type=ScrollWheel loc=(847,494) time=295067.9 flags=0x100 win=0x10363cda0 winNum=6052 ctxt=0x0 deltaX=0.000000 deltaY=0.000000 deltaZ=0.000000 deviceDeltaX=0.000000 deviceDeltaY=1.000000 deviceDeltaZ=0.000000 phase=Changed momentumPhase=None
NSEvent: type=ScrollWheel loc=(847,494) time=295067.9 flags=0x100 win=0x10363cda0 winNum=6052 ctxt=0x0 deltaX=0.000000 deltaY=0.816177 deltaZ=0.000000 deviceDeltaX=0.000000 deviceDeltaY=6.000000 deviceDeltaZ=0.000000 phase=Changed momentumPhase=None
[...]
NSEvent: type=ScrollWheel loc=(847,494) time=295068.9 flags=0x100 win=0x10363cda0 winNum=6052 ctxt=0x0 deltaX=0.000000 deltaY=0.000000 deltaZ=0.000000 deviceDeltaX=0.000000 deviceDeltaY=1.000000 deviceDeltaZ=0.000000 phase=Changed momentumPhase=None
NSEvent: type=ScrollWheel loc=(847,494) time=295068.9 flags=0x100 win=0x10363cda0 winNum=6052 ctxt=0x0 deltaX=0.000000 deltaY=0.000000 deltaZ=0.000000 deviceDeltaX=0.000000 deviceDeltaY=0.000000 deviceDeltaZ=0.000000 phase=Ended momentumPhase=None
NSEvent: type=EndGesture loc=(847.008,493.305) time=295068.9 flags=0x100 win=0x10363cda0 winNum=6052 ctxt=0x0 subtype=6


Possibly the HID Manager could be used - apparently it posts a device-specific event just before the NSEvent, allowing you to distinguish which device the NSEvent is from (at least for keyboard devices, not sure if the same is true for pointing devices). Also HID Manager APIs would be a cleaner way to determine if the user has a trackpad at all as opposed to the current approach using sysctl.
http://www.cocoabuilder.com/archive/cocoa/229902-which-keyboard-barcode-scanner-did-the-event-come-from.html
jensverwiebe (jens verwiebe) added a comment.Via Old WorldOct 31 2011, 11:10 PM
For the moment i enabled m_has_multitouch for all Macs.
This causes most situations input devices behave as they should exept the MagicMouse pad pan`s instead of zoom´s.
( Where i expected it NOT a gesture due only 1 finger used so should have switched to wheel behaviour, but does not ).

Investigating atm how i can distinguish these events ..

Jens
jensverwiebe (jens verwiebe) added a comment.Via Old WorldNov 29 2011, 12:39 PM
Update:

Due we still support older OSX versions, would be hard to use the newer NSTouch classes i guess.
A proposal could be to have a switch to determine how MagicMouse "trackpad" is handled.
Aka: MM trackpad zooms/pan´s with a user_pref. This would also solve the problem for MacBook users
having a MM connected for use with Blender. ( and vice versa having MacPro users using a MagicTrackpad )

Jens
sourvinos (Paolo Sourvinos) added a comment.Via Old WorldFeb 6 2013, 11:32 PM
For me all problems with Lion and the Magic Mouse arose around r53400, after Ton's changes to UI, nothing ascribing to Lion in itself.
So I think it should be not too difficult to reverse those changes, or detect issues.

paolo
ton (Ton Roosendaal) added a comment.Via Old WorldFeb 7 2013, 9:49 AM
Just get the official test build and try if it works. (frontpage blender.org)
All magic mouse owners (incl me) have it working perfectly.

It doesnt work if you compile blender with wrong settings.
sourvinos (Paolo Sourvinos) added a comment.Via Old WorldFeb 7 2013, 8:59 PM
I tried the test build, now the 'zoom to cursor' works again, very jumpy though, while my builds are flowless.

The Headers panning still not working, and I wonder how can it works, given that both zooming in 2d views and panning in the headers share the same shortcuts.

Thank you
ton (Ton Roosendaal) added a comment.Via Old WorldFeb 8 2013, 10:11 AM
I loaded this:
http://download.blender.org/release/Blender2.66/blender-2.66-testbuild1-OSX_10.6-x86_64.zip

Works all fine for Magic mouse in 10.7 iMac. Try factory settings, in case you made yourself keymaps for "Mouse/Trackpad Pan".
sourvinos (Paolo Sourvinos) added a comment.Via Old WorldFeb 8 2013, 10:05 PM
I downloaded just that, but in the default scene and with factory setting the zooming is very jumpy, and mouse panning in the headers works only if i assign 'trackpad pan' to it, but this way If I spin the wheel in 2d views I get panning instead of zoom, of course, being both in the same section of input user pref (view 2d).
It would seem logical to me to assign to the zoom function the trackpad zoom action but this does nothing everywhere, and the only working wheel mouse action is trackpad pan.

I hope I explained it clearly enough.

Thank you anyway
sourvinos (Paolo Sourvinos) added a comment.Via Old WorldFeb 8 2013, 10:41 PM
HURRAH!
I just built r54398 and all seems to work fine now!
Panning in the headers works again without loosing the 2d view zooming, and zooming is smooth (as in any other build by me).

Maybe your commit #54385 did the trick, (I cant understand your notes, damned my English).

Thank you again!

paolo
sourvinos (Paolo Sourvinos) added a comment.Via Old WorldFeb 8 2013, 11:08 PM
Last note:

The zoom works only in Image editor, all other 2d editors still panning instead (if I want the headers panning to works).
that's because only Image editor has its own reserved shortcuts in 'Image (Global)'


paolo
jensverwiebe (jens verwiebe) added a comment.Via Old WorldFeb 9 2013, 10:06 AM
Hi Paolo

The "zoom works only in Image editor, all other 2d editors still panning instead" was made on purpose by Ton.
I haven't played with this as much as to finally judge if this is a good implementation, tending to say the inconsistent
usage of same control for different actions is suboptimal.
Personally i also dislike the ctrl-wheel(mm pad) for zooming, cause it is a sytem default for HW zoom in OSX.
But this should be discussed in the end.

Jens
sourvinos (Paolo Sourvinos) added a comment.Via Old WorldFeb 9 2013, 10:24 AM
Hi Jens,

the major issue AFAIK is that in 2d views there is not another way to zoom (except the View menu in the Node editor), no shortcuts.

Thank you, paolo
ton (Ton Roosendaal) added a comment.Via Old WorldFeb 9 2013, 10:50 AM
I really cannot follow this.

All 2d editors use same input methods, and pan default with trackpad or magic mouse. Zoom is with holding ctrl. This is compatible to how middle mouse is working there

Apple shouldn't have picked ctrl+swipe for a desktop shortcut default in the first place.
In Blender ctrl is used everywhere for zooming for 15 years, so it's not been "my decision" but just a conflict with a system default. Disable it or make your own keymap setting for now. How to cope with this shortcut conflict is something we can investigate, but not here.
ton (Ton Roosendaal) closed this task as "Invalid".Via Old WorldFeb 9 2013, 10:50 AM
jensverwiebe (jens verwiebe) added a comment.Via Old WorldFeb 9 2013, 11:43 AM
Paolo, i don't agree fully, you can simply +/- for zoom still.

Jens
sourvinos (Paolo Sourvinos) added a comment.Via Old WorldFeb 9 2013, 12:03 PM
I'm sorry Ton, I have some difficult to follow you, cause my English perhaps I understand wrongly.
Since 2.5 beta I always used scrolling mouse for zooming, I never used Ctrl; using Ctrl for zoom means you have to use keys, not the best imho, moreover Ctrl+wheel is reserved by System.
Apple have had this shortcut since the mists of time.

If I change shortcuts I miss the panning in the header, and if a window is too narrow and some buttons are hidden it's a mess.

@Jens,
nope, I haven't the numpad, and the + never worked to me (while the 'minus' does) so I can zoom out only.

Thank you anyway,

paolo
ton (Ton Roosendaal) added a comment.Via Old WorldFeb 9 2013, 12:19 PM
Then just set zoom to use the apple command key. Image zoom and Clip zoom don't use the view2d keymap either, so you can set it separately.

Basically a magic mouse is a trackpad, and that's how it's working in blender now... the fact it used to mimic scrollwheel wasn't very nice either.

Consistency for input methods is really a nice feature, even though it might take a little while to get used to.
sourvinos (Paolo Sourvinos) added a comment.Via Old WorldFeb 9 2013, 4:03 PM
Ton,
apart from my, and only my, personal problems I think that the chance of zooming by the mouse only, without the keyboard, together with the 'zoom at cursor' feature is a great way to navigate in the viewports.

Actually I got Image and Clip editors to work fine, issues remain for other 2d editors, just because of lacking of separate setting

Thank you for your time and assistance,

paolo
rivasgrafix (Paul Rivas) added a comment.Via Old WorldMar 2 2013, 7:42 PM
Using MagicPrefs I am able to set it to Zoom In/Out. After using this, if you keep your fingers on the mouse the Zoom features continues to work through the Middle In/Out. Hope this helps some.

Add Comment