Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problematic "mousewheel" scrolling characteristics using particular track pads #1

Open
specious opened this issue Feb 11, 2014 · 1 comment
Labels

Comments

@specious
Copy link
Owner

"Mouse wheel" scrolling is ridiculously sensitive and unmanageable when using track pads which send out many signals in quick succession (such as on the MacBook Pro). Unfortunately, since there appears to be no way to know directly what type of device is triggering the mousewheel events, it is not trivial to somehow normalise or "tame" the input from the track pad without also affecting the "1 tick per click" behaviour of the standard mouse wheel. @darsain has described the same phenomenon in this discussion at the sly.js project. Ideas are appreciated.

Here is a recording of a light swipe using two fingers on a MacBook Pro track pad:

c9-trackpad

The following is a recording of a down-scroll of 4 ticks using the mouse wheel on a USB mouse:

c9-mousewheel

dt is the time (in milliseconds) elapsed since the last event.

@specious
Copy link
Owner Author

I had some success taming the response to the track pad on my MacBook Pro with:

      if( options.mouseWheel ) {
        var t;
        var tLast = 0;
        var tReset = 120;
        var dt;
        var d = 0;

        container.bind( 'mousewheel.cloud9', function( event, delta ) {
console.log( "====== delta: " + delta )
          t = new Date();
          dt = t - tLast;
          tLast = t;
console.log( "=== dt: " + dt )

          if( dt > tReset ) {
            d = 0;
            self.go( (delta > 0) ? 1 : -1 );
          } else {
            d += Math.log( Math.abs( delta ) * 20 );

            if( Math.abs( d ) > 40 ) {
              d = 0;
              self.go( (delta > 0) ? 1 : -1 );
            }
          }

          return false;
        } );
      }

However, that of course distorts the response to a standard well-behaving mouse wheel. Attempting to determine the nature of the input device would be easy if the track pad didn't emit deltas of magnitude 1 among other potential values.

Any ideas?

@specious specious changed the title Crazy "mousewheel" scrolling characteristics using certain track pads Problematic "mousewheel" scrolling characteristics using certain track pads Nov 29, 2016
@specious specious changed the title Problematic "mousewheel" scrolling characteristics using certain track pads Problematic "mousewheel" scrolling characteristics using particular track pads Nov 29, 2016
@specious specious added the issue label Nov 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant