Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

asiga

macrumors 65816
Original poster
Nov 4, 2012
1,140
1,514
Hi,

I'm trying to correctly respond to both "traditional mouse wheel" events and Mighty Mouse ("scroll ball") events from an application that runs on 10.4 Tiger (yes, old, but it has to run on Tiger, sorry).

By taking a look at how wxWidgets does it (lines 519-541 from http://trac.wxwidgets.org/browser/svn-wx/wxWidgets/trunk/src/osx/cocoa/window.mm?rev=63370 ), I see they get the Carbon event from the NSEvent by using its eventRef, and then they check it with kEventMouseScroll in order to see if it's a scroll wheel or a scroll ball.

Unfortunately, eventRef was introduced in 10.5 Leopard. And, unfortunately, I get errors if I try to access deviceDeltaX and deviceDeltaY if the event didn't came from an scroll ball. So, I need to check whether the event came from a scroll wheel or a scroll ball, so that I know if I need to access deltaX/deltaY or deviceDeltaX/deviceDeltaY.

Any suggestions on how can I achieve this on Tiger?

Thanks a lot!
 
Nevermind, after deeper search, I found there's an undocumented '_eventRef' that works fine on 10.4. It was renamed to 'eventRef' on 10.5 (and turned to be documented too).
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.