I am looking for the algorithm that is used in laptop touchpads to control the screen pointer. It clearly is non trivial as the pointer displacement depends on the speed and distance covered by the finger on the touchpad.
Asked
Active
Viewed 940 times
2
-
Do you mean from an electrical engineering perspective? – Rowland Shaw Jul 27 '13 at 18:29
-
I mean for example - that for one touch operation, I have the start and end touch coordinates and the time it took. How do I use this information to decide the amount of pointer displacement? – abhishek Jul 27 '13 at 18:33
-
So if you the change in location; you could apply the same change to the pointer? What makes you think there's crazy maths, or a complex algorithm involved here (other than the complex bits to work out where there is a touch, which is more the electrical engineering side of the fence)? – Rowland Shaw Jul 27 '13 at 18:36
-
When the finger drag is done over the same distance with different speeds, the pointer displacement is different - I just want to know what that function is - I could use trial and error but would have been ideal if I had the actual algorithms in use – abhishek Jul 27 '13 at 18:42
-
1I'm just guessing, but the way the underlying electronics works is almost certainly by sampling the (x, y) location of the touch many times per second. Subtracting these from the previous position gives you a (dx, dy) pair. Acceleration can then be achieved by e.g. squaring these differences before using them to update the mouse pointer location on screen. – j_random_hacker Jul 27 '13 at 18:45
2 Answers
0
I am not touchpad expert, but here a some ideas:
- Pressed keyboard keys shortly before and after touchpad (TP) event;
- Series of events starting from tapping, (not moving);
- If TP is capable to tell area of touching: big area is touched (palm, not a finger);

Leonid Volnitsky
- 8,854
- 5
- 38
- 53
0
As you mentioned, it is non-trivial. There are two factors - distance and speed. The more important one is the speed.
More the speed, more the actual distance is covered on the screen by the pointer and you keep on covering distance based on speed till you keep sensing any movement. So you can think of it as rate of change of finger position on the touchpad.
So all you need is a simple mathematical function converting actual speed and distance on the touch pad to the speed and distance of the pointer on the screen. Maybe even a simple polynomial function should do the trick.

Sahil
- 69
- 1
- 1
- 8