Code Monkey home page Code Monkey logo

Comments (1)

schuhumi avatar schuhumi commented on June 16, 2024

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...

from xf86-input-mtrack.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.