Scroll Ball Direction

Sage
Posts: 1,403
Joined: 2005.07
Post: #1
I setup an NSView with this method,

Code:
- (void)scrollWheel:(NSEvent *)theEvent
{
    NSLog(@"(%f, %f)", [theEvent deltaX], [theEvent deltaY]);
}

and when moving the mighty mouse scrollball around up and down, left and right, and diagonally the values are always (x, 0) or (0, x), there is never a value printed out with two non-zero numbers,
Is there any level/API at which I can get the true scroll ball deltas?

Sir, e^iπ + 1 = 0, hence God exists; reply!
Quote this message in a reply
Moderator
Posts: 1,560
Joined: 2003.10
Post: #2
Is it possible that this is specific to the Mighty Mouse? I can scroll diagonally in Finder windows with my MacBook Pro trackpad, but I think I remember having trouble scrolling diagonally at all with a Mighty Mouse when I tried one.
Quote this message in a reply
Sage
Posts: 1,403
Joined: 2005.07
Post: #3
Yeah, my question is specific to the Mighty Mouse. I am assuming that somewhere in the OS the lowest value of the scroll ball (out of x and y) are zero'd before being turned into an NSEvent and dispatched.

So can I capture scollball values with another API or set of functions than NSEvent?
or does anyone know that the mighty mouse just doesnt send out directional values, so its impossible to do what I want?

Sir, e^iπ + 1 = 0, hence God exists; reply!
Quote this message in a reply
Member
Posts: 72
Joined: 2006.10
Post: #4
What most likely happens is that the diagonal message gets split in two individual messages.

What you could do is add (or use a filter such as an average or kallman) the deltas over a period of time, one frame might do, since any diagonal scroll would create near-instantinuous messages. And the latency created would not be noticeable.

Also, it might be that both messages are queued at the same time before any resolving takes place, in wich case, you could query the event queue for scroll messages and combine them right then and there.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #5
Even if the mouse driver for the OS is messing with the scrolling deltas, you ought to be able to get the raw deltas from HID...
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  HID get scroll ball deltas unknown 1 2,085 Oct 30, 2006 12:27 PM
Last Post: OneSadCookie