aboutsummaryrefslogtreecommitdiffstats
path: root/src/gestures.c
Commit message (Collapse)AuthorAgeFilesLines
* Simplify bit bookkeepingHenrik Rydberg2010-05-141-17/+13
| | | | | | | | In preparation of adding several additional finger bit registers, remove the redundant bit-counting variables and introduce fast bit-traversal functions instead. Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* Only emit multi-finger button events for real button eventsHenrik Rydberg2010-04-181-3/+7
| | | | | | | | | The current implementation will emit additional multi-finger click events if, for instance, one finger is removed before releasing the button. This patch makes sure logical buttons events are only emitted as a result of a real button event. Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* Make all movement computations work on pointing subsetHenrik Rydberg2010-04-181-0/+2
| | | | | | | | In the current implementation this patch has no effect, but with any change to the logic, it will. Add the lines missing in order to loop over pointing fingers. Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* Unify detection of finger configuration changesHenrik Rydberg2010-04-151-13/+17
| | | | | | | | | | This patch simplifies and unifies the means by which finger configuration changes are detected. The logic is almost the same, except for the unlikely case of very quickly switching the clicking finger, after first having moved it above the clicking area. This case should now properly be detected as a pointing finger. Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* Reset accumulated movement at finger configuration changeHenrik Rydberg2010-04-151-0/+2
| | | | | | | | | This bug crept in during the transition of the movement code from position differencing to delta accumulation. If briefly touching the trackpad in motion, then placing the finger calmly at another point, a jittery motion would occur. Fixed with this patch. Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* Add memory debug convenience routinesHenrik Rydberg2010-04-151-0/+3
| | | | | | Output parsing memory values, switched off by default. Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* Extract moving fingersHenrik Rydberg2010-04-151-17/+52
| | | | | | | | | | | | The current code determines the moving, scrolling and swiping gestures based on the number of fingers on the trackpad, including the resting fingers at the bottom of the pad. With information about all fingers at hand, it is possible to determine which fingers on the trackpad are participating in a moving gesture. This patch computes the movement based on the pointing fingers only, and uses that number to determine the type of moving gesture. Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* Extract pointing fingersArturo Castro2010-04-151-2/+42
| | | | | | | | | | | | | | | Multi-finger clicks and taps are goverened by the number of pointing fingers on the trackpad. This number can be different from the actual number of fingers on the trackpad. For instance, a finger resting at the bottom of an integrated button, or a finger that accidentally touches the pad during a press, are not pointing fingers. This patch introduces extract_pointers(), which computes the number of pointing fingers on the trackpad, and uses that number to determine the logical button state. [rydberg@euromail.se: various cleanups] Signed-off-by: Arturo Castro <arturo@openframeworks.cc> Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* Define swipe gesturesHenrik Rydberg2010-04-151-4/+12
| | | | | | | Define three-finger vertical and horizontal scroll as vertical and horizontal swipe gestures. Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* Drop movement during gesture decayArturo Castro2010-04-151-2/+7
| | | | | | | | | | | With this patch, finger motion is divided into two phases; one attack phase where fingers are added to the trackpad, and one decay phase, where fingers leave the trackpad. The decay delay is set considerably larger than the attack delay. The prime effect is to ignore accidental pointer movement right after a two-finger scroll. Signed-off-by: Arturo Castro <arturo@openframeworks.cc> Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* Add a gesture credits sectionHenrik Rydberg2010-04-151-0/+4
| | | | Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* Delay movement after a finger configuration changeArturo Castro2010-04-151-8/+20
| | | | | | | | | | The current code responds to finger movement immediately after a finger has been placed on the trackpad, even if the touch is accidental. This patch delays the effect of the finger by 70 ms, resulting in fewer accidental movements. Signed-off-by: Arturo Castro <arturo@openframeworks.cc> Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* Keep logical buttons separate from the hardware onesHenrik Rydberg2010-04-151-4/+8
| | | | | | | | | The button extraction currently modifies the MTState buttons, upsetting the semantics in a bad way. This patch adds the logical button state to the Memory structure, and uses it to compute the logical button change. Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* Only extract movement from identical finger configurationsHenrik Rydberg2010-04-151-16/+21
| | | | | | | | | The current code would extract movement from a rapid change from one finger to the next, resulting in unwanted jumps. This patch first checks that the finger configuration is the same before attempting to extract movement. Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* Reorganize gesture codeHenrik Rydberg2010-04-151-18/+32
| | | | | | | Break out extraction of movement, buttons and type. Only code traversal, no logical changes. Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* Introduce the MTStateHenrik Rydberg2010-04-151-11/+12
| | | | | | | | | | | | | | | The HWState keeps, for good reason, both touching fingers and fingers going away. However, this implies that additional logic is needed to keep track of the number of actual touching fingers. In particular the test for touching fingers is somewhat misplaced in hwstate.c. Moreover, HWState should only exist in one instance, since it contains data which does not need to be referred to during gesture extraction. This patch introduces the MTState structure, which keeps more digested data for gesture extraction. In particular, it only keeps the actual touches. Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* Rename State to HWStateHenrik Rydberg2010-04-151-11/+11
| | | | | | | Rename the hardware state struct State to HWState, to make room for additional state structures. Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* janitor: remaining indentation fixedHenrik Rydberg2010-02-021-2/+2
|
* janitor: stick to kernel-style formattingHenrik Rydberg2010-02-011-1/+2
| | | | | | With this commit, the whole code base complies with the kernel format style, and patches can be checked against the kernel-provided ./scripts/checkpatch.pl
* button: simplify button handlingHenrik Rydberg2010-02-011-8/+2
| | | | | Make better use of the bit representation, reducing one layer of conversion.
* common: add some more bit utilitiesHenrik Rydberg2010-02-011-3/+3
|
* License and credits resolvedHenrik Rydberg2010-01-301-0/+21
| | | | | | All files are tagged as GPL, and a CREDIT file created with references to the synaptics X driver and the matching code, under their respective MIT and BSD licenses.
* Add multi-finger button and scroll from experimentalHenrik Rydberg2009-05-161-0/+10
| | | | Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* Gesture interface in placeHenrik Rydberg2008-11-091-0/+39
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>