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

Cannot scroll down/scroll right #49

Open
guruthree opened this issue Mar 26, 2013 · 1 comment
Open

Cannot scroll down/scroll right #49

guruthree opened this issue Mar 26, 2013 · 1 comment

Comments

@guruthree
Copy link

I'm trying to use my Magic Trackpad. For some reason I can't scroll down or to the right, while up and left works fine. I'm using mtrack 0.3.0 on xorg-server 1.13.1, bluez 4.101-r5, kernel 3.8.4-gentoo.

I enabled debugging.
http://guru3.net/temp/scrollup.txt
http://guru3.net/temp/scrolldown.txt
http://guru3.net/temp/threetap.txt

It looks somehow like scrolling down is either flat out not detected or is detected as a rotate. This may be related to the fact that occasionally when middle clicking (three tap) the mouse pointer goes flying.

I'm not sure exactly what the issue is, but it looks like some sort of integer wrapping issue may be happening:
(II) is_thumb: no -2147483648 > 70 && 0 > 25

The trackpad works fine on another computer with mtrack.

@schuhumi
Copy link
Contributor

I think I've found the problem:
See this line of code: https://github.com/BlueDragonX/xf86-input-mtrack/blob/master/src/gestures.c#L572

t1->direction and t2->direction do not get checked if they are valid directions (see https://github.com/BlueDragonX/xf86-input-mtrack/blob/797719796a53a24fa6cd72fc3909a490ed807bec/include/trig.h#L40 ). When one finger is not moving, one of the directions is TR_NONE, which as a number is -1.00

Now, when the other finger is moving upwards (0.00) or upper-left (6.00-7.99) the scrolling works, because the difference (trig_angles_acute) between -1.00 (TR_NONE) and 0.00 respectively 6.00-7.99 (overflow, like from 360° to 0°) is small enough.

When moving the other finger down or right (2.00, 4.00), the difference is >2 and therefore too big to trigger a scrolling event.

Now the bigger problem with this is: For some odd reason my touchpad (it's the touchscreen of an Galaxy S2 Smartphone (i9100), which has an Atmel MXT224 touchcontroller) always reports one direction as TR_NONE (-1.00) when moving two fingers?!? Example (moving 2 fingers upwards (=0.00)):

(II) t1dir: -1.00 , t2dir: 0.41 
(II) t1dir: 0.00 , t2dir: -1.00 
(II) t1dir: -1.00 , t2dir: 0.00 
(II) t1dir: 0.00 , t2dir: -1.00 
(II) t1dir: -1.00 , t2dir: 0.00 
(II) t1dir: 0.00 , t2dir: -1.00 
(II) t1dir: -1.00 , t2dir: 0.00 

I did this to make scrolling possible anyways:

if (t1->direction == TR_NONE) // if no movement in t1
{
    return trig_generalize(t2->direction); // use t2 only to determine direction
}
else if (t2->direction == TR_NONE) // and vice versa
{
    return trig_generalize(t1->direction);
}
else if (trig_angles_acute(t1->direction, t2->direction) < 2.0) {

But the issue of the touchpad reporting one finger as TR_NONE when moving two of them remains, which bugs me since it renders the the other gestures (rotate, scale) unuseable...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants