summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* refactor: Introduce mtdevHenrik Rydberg2010-06-165-1/+597
| | | | | | | | | | | | With the addition of the kernel MT slots, the MT event protocol is capable of efficiently propagating changes to a set of tracked contacts. At the same time, the need to treat a variety of different kernel drivers is increased. This patch introduces the mtdev, an abstract MT device which converts all valid MT event formats into a uniform, slotted type B event stream. A command-line test program is included. Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* refactor: Use the bitmask_t typeHenrik Rydberg2010-06-166-8/+8
| | | | | | | Use the bitmask_t for all bitfields, to simplify future expansions to larger bit fields. Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* refactor: Simplify capabilitiesHenrik Rydberg2010-06-167-93/+85
| | | | | | | Use the generated abs2mt mapping to simplify the MT device capabilities. Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* refactor: Generate code for ABS_MT mappingHenrik Rydberg2010-06-164-0/+123
| | | | | | | | | Use the kernel-provided list MT_SLOT_ABS_EVENTS to generate code mappings between ABS_MT space and MT space. This patch adds the program mapgen that does the mapping, and adds two include files generated with it. Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* refactor: Move filesHenrik Rydberg2010-06-1620-64/+127
| | | | | | | | | | Move all headers into include, separate source files into modules match, mtdev, src and driver, move some common definitions to common.h, and include define support for the MT slot protocol. This patch does not introduce any logical changes. Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* Allow ABI_XINPUT versions greater than 7Henrik Rydberg2010-05-171-1/+1
| | | | | | | | The current code does not allow ABI_XINPUT versions above 7, although the relevant parts are still good. This patch makes all new versions behave as version 7, until proven otherwise. Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* Add rotation gesturev1.0-alpha3Henrik Rydberg2010-05-144-6/+28
| | | | | | | | Moving two fingers around a center point will trigger the gesture. This patch computes the rotation gesture and maps it to mouse buttons 14 and 15. Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* Add scale gestureHenrik Rydberg2010-05-144-5/+49
| | | | | | | | Moving two fingers apart or closer together will trigger the gesture. This patch computes the scaling gesture and maps it to mouse buttons 12 and 13. Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* Hold movement while clickingHenrik Rydberg2010-05-141-1/+5
| | | | | | | | In particular for trackpads with integrated button, freezing the mouse movement while clicking is important for pointer precision. This patch holds the movement while clicking, obtaining the desired effect. Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* Disable motion with resting thumbsHenrik Rydberg2010-05-143-5/+20
| | | | | | | | Disable motion gestures whenever one of the pointing fingers is a thumb. Movement is skipped rather than held, minimizing unpredictable movement after thumb release. Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* Add resting thumb detection to MTFingerHenrik Rydberg2010-05-142-1/+27
| | | | | | | | | | | | | | Robust thumb detection is essential for more advanced gestures, thumbs being responsible for many false positives. One major feature of the thumb is that its shape is oval, regardless of applied pressure. An index finger pressed hard against the surface also turns oval, but the touch/width ratio then increases significantly. This suggests that it is possible to uniquely identify a resting thumb as a finger with oval shape and normal touch/with ratio. This patch adds detection of resting thumbs to the MTFinger structure. Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* Refactor parsor memory usageHenrik Rydberg2010-05-144-70/+112
| | | | | | | Add the bitmasks "fingers" and "added" to parsor memory, and extend time handling to use a hold time and a forget time. Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* janitor: Split gesture code into memory refresh and parseHenrik Rydberg2010-05-144-135/+226
| | | | | | | | Split the gesture code into a lexical part, which updates the filtered motion state, and a parsing part, which translates the motion state to gestures. Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* Add convenience methods for distance to capability center pointHenrik Rydberg2010-05-143-0/+27
| | | | Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* Introduce MTFinger structureHenrik Rydberg2010-05-143-11/+27
| | | | | | | Switch from the FingerData structure to the MTFinger structure, making room for more computed finger details in MTState. Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* janitor: Move min/max and dist functions up to common.hHenrik Rydberg2010-05-144-19/+24
| | | | Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* Simplify bit bookkeepingHenrik Rydberg2010-05-145-21/+43
| | | | | | | | 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>
* Add a READMEHenrik Rydberg2010-05-141-0/+8
| | | | | | The github likes readme files, so add a rudimentary one. Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* Increase touch/width signal-to-noise ratioHenrik Rydberg2010-04-191-1/+1
| | | | | | | | The current signal-to-noise ratio for the touch size is much too low, making the pointer feel too insensitive. This patch increases the ratio from 15 to 100. 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>
* Hold MT data during pure button eventsHenrik Rydberg2010-04-182-2/+8
| | | | | | | | | | | Some devices send button events through a separate device, causing the driver to temporarily lose the MT state. As a result, spurious button events are emitted in conjunction with multi-finger clicks. This patch makes sure that the MT state is updated only after receiving MT data, restoring click normality. Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* Filter non-zero finger width eventsHenrik Rydberg2010-04-183-4/+24
| | | | | | | Add filtering also to touch/width events, but be careful to treat a zero touch exactly as zero. 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>
* Do not reuse tracking ids after a no-touch eventHenrik Rydberg2010-04-181-2/+11
| | | | | | | | | | | | | The fingers going away are important in the matching algorithm, to correctly detect new fingers when placed close to a finger in the process of leaving the surface. However, once a no-touch has been confirmed, the tracking id should not be reused, should a new finger appear close to the removal point. This patch clears the tracking id of all removed or no-touch state fingers, thereby reducing accidental jumps on touch to a minimum. Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* Correctly report zero fingersHenrik Rydberg2010-04-181-1/+2
| | | | | | | | | | | | This bug has been around since before alpha1, and yet the topic of commit c7ed4c, prior to alpha1, was about precisely this; With the bug, the last tracking id will sometimes be continued with a new touch, resulting in a cursor jump. This patch correctly sets zero fingers in HWData after receiving a zero-finger event. Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* Reset scroll state on finger configuration changeHenrik Rydberg2010-04-151-0/+6
| | | | | | | | | | | When scrolling, the current code remembers how close the movement is to emitting a scroll button, in order to produce a continuous stepping motion. However, when the finger configuration on the trackpad changes, this state should start over again, or the next scolling gesture may scroll prematurely. This patch resets the scrolling state when a change is detected, which fixes the problem. Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* Unify detection of finger configuration changesHenrik Rydberg2010-04-152-14/+18
| | | | | | | | | | 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>
* janitor: Use more common row/column namesHenrik Rydberg2010-04-151-10/+10
| | | | Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* Multitouch 1.0-alpha2v1.0-alpha2Henrik Rydberg2010-04-151-1/+1
|
* Add memory debug convenience routinesHenrik Rydberg2010-04-153-0/+16
| | | | | | Output parsing memory values, switched off by default. Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* Extract moving fingersHenrik Rydberg2010-04-152-19/+57
| | | | | | | | | | | | 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-152-3/+44
| | | | | | | | | | | | | | | 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>
* Add constant clicking area to capabilitiesHenrik Rydberg2010-04-152-0/+5
| | | | | | | | The trackpads with integrated button have a dedicated clicking area at the bottom of the pad. This patch adds the position of the onset of the clicking area to capabilities. Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* Add integrated button property to capabilitiesHenrik Rydberg2010-04-152-1/+11
| | | | | | | | | The new Apple unibody macbooks have a trackpad with an integrated button, which needs special treatment. This patch tests the device for an integrated button and keeps the result in the capabilities struture. Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* Additional device informationHenrik Rydberg2010-04-152-0/+11
| | | | | | | Add information about the device name and device identifier from the EVIO protocol. Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* Define swipe gesturesHenrik Rydberg2010-04-153-10/+32
| | | | | | | Define three-finger vertical and horizontal scroll as vertical and horizontal swipe gestures. Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* Define swipe buttonsHenrik Rydberg2010-04-152-2/+13
| | | | | | Define four additional buttons to be used for swiping gestures. Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* Break out scrolling codeHenrik Rydberg2010-04-151-18/+18
| | | | | | Move the duplicated scrolling code to a function. 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-152-8/+22
| | | | | | | | | | 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>
* Add robust position event filteringHenrik Rydberg2010-04-153-0/+31
| | | | | | | | | | The kernel filtering is bypassed for MT events. This patch reintroduces filtering at the earliest possible point, right after the fingers have been identified. For drivers that do not set proper fuzz parameters, sensible values are derived based on a generic signal-to-noise ratio. The defuzz code is borrowed from the Linux kernel, thanks GPL. Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* Keep logical buttons separate from the hardware onesHenrik Rydberg2010-04-153-4/+10
| | | | | | | | | 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 MemoryHenrik Rydberg2010-04-155-0/+62
| | | | | | Add the Memory structure to hold the multitouch parsing state. Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* Do not sort HWState fingersHenrik Rydberg2010-04-151-8/+0
| | | | | | | The fingers are currently sorted in tracking id order, for no good reason. This patch removes the sorting. Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* Add MTState debug outputHenrik Rydberg2010-04-151-0/+3
| | | | Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* Introduce the MTStateHenrik Rydberg2010-04-158-86/+159
| | | | | | | | | | | | | | | 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>