Menu

#38 Scroll up and down both return 0

open
None
5
2010-03-10
2008-11-01
No

Scrolling slowly up or down can both return 0 from -[NSEvent deltaY]. The result is that scrolling down slowly is misinterpreted as scrolling up. Other drivers can return 0 for scrolling up but always return a negative number for scrolling down.

I've attached an Xcode project for a simple program that displays deltaY values. Just scroll in the blank part of the window.

Discussion

  • Steve Nicholson

    Steve Nicholson - 2008-11-01

    Simple program to display -[NSEvent deltaY] values

     
  • Daniel Becker

    Daniel Becker - 2010-03-10
    • assigned_to: nobody --> razzfazz
     
  • Daniel Becker

    Daniel Becker - 2010-03-10

    Why would (or should) a delta of 0 lead to any scrolling at all?

     
  • Steve Nicholson

    Steve Nicholson - 2010-03-10

    "Why would (or should) a delta of 0 lead to any scrolling at all?"

    I think a better question would be "Why does the driver return a value of 0 when the scroll wheel is moved?" I think it should either return a positive or negative value. (Please note I no longer have a PowerPC computer, so if no one else cares about this issue you shouldn't waste any time working on it.)

     
  • Daniel Becker

    Daniel Becker - 2010-03-10

    I'm guessing this is a result of the raw trackpad inputs being scaled and then rounded to an integer; I guess it shouldn't be too hard to add some code that suppresses scroll events with zero delta...

     
  • Daniel Becker

    Daniel Becker - 2010-03-10

    Ah, turns out I actually do check for zero deltas, and only generate an event when at least one of the (enabled) axes has a non-zero delta. Since dispatchScrollWheelEvent handles both axes simultaneously, I guess you could still see zero deltas for one axis if there is a non-zero delta on the other one. Not sure what to do about that, though -- like I said, dispatchScrollWheelEvent requires me to specify deltas for all axes every time...

     

Log in to post a comment.

MongoDB Logo MongoDB