Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| synapticstouchpad [2018/12/15 13:54] – Rejig introduction sentence KubilayKocak | synapticstouchpad [2022/08/18 05:58] (current) – Indent command/file/code lines for readability KubilayKocak | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Synaptics Touchpad | + | ===== Synaptics Touchpad ===== |
| - | The Synaptics Touchpad is a pointing device, found on many laptops for instance. | + | ===== Introduction ===== |
| - | You might want to see [[https:// | + | The Synaptics Touchpad is a pointing device found on many laptops and supported since %%FreeBSD%% 8. |
| - | This device is supported since %%FreeBSD%% 8 and by default, is recognized as a standard | + | By default, |
| + | |||
| + | Also check out [[https:// | ||
| ===== Features ===== | ===== Features ===== | ||
| - | * better | + | * Improved |
| - | * tap detection with one (left click), two (right click) or three (middle click) | + | * Tap detection with one (left click), two (right click), or three (middle click) |
| - | * tap-hold detection with one, two or three fingers. | + | * Tap-hold detection with one, two, or three fingers. |
| - | * virtual | + | * Virtual |
| - | ===== How to use it ===== | + | ===== Setup ===== |
| - | You must add the following line in '' | + | To enable psm(4) Synaptics support, |
| < | < | ||
| Line 22: | Line 24: | ||
| </ | </ | ||
| - | You'll need moused(8) | + | Enable |
| < | < | ||
| Line 28: | Line 30: | ||
| </ | </ | ||
| - | To use it with X.Org, | + | To use it within |
| < | < | ||
| Line 40: | Line 42: | ||
| </ | </ | ||
| - | Horizontal scrolling is disabled by default. To enable it, you need to set a sysctl (in your '' | + | Horizontal scrolling is disabled by default. To enable it, add the following |
| < | < | ||
| Line 46: | Line 48: | ||
| </ | </ | ||
| - | ===== sysctl documentation | + | ===== Touchpad Configuration |
| - | ==== Palm detection | + | ==== Palm Detection |
| - | === Finger | + | === Finger |
| < | < | ||
| Line 57: | Line 59: | ||
| </ | </ | ||
| - | If the pressure is less than '' | + | If the pressure is less than '' |
| * z = 0: no finger contact | * z = 0: no finger contact | ||
| * z = 10: finger hovering near the pad | * z = 10: finger hovering near the pad | ||
| Line 66: | Line 68: | ||
| * z = 255: maximum reportable Z | * z = 255: maximum reportable Z | ||
| - | === Finger | + | === Finger |
| < | < | ||
| Line 77: | Line 79: | ||
| * w = 15: maximum reportable width (capPalmDetect needed | * w = 15: maximum reportable width (capPalmDetect needed | ||
| - | ==== Movement | + | ==== Movement |
| - | To smooth the movement, we use a weighted average then a division where both the weight and the divisor vary, depending on the movement speed. See "How it works" | + | For movement |
| < | < | ||
| Line 109: | Line 111: | ||
| This multiplicator is used during averages and divisions to increase the precision. | This multiplicator is used during averages and divisions to increase the precision. | ||
| - | === Touchpad borders | + | === How Movement Smoothing Works === |
| - | The touchpad | + | The smoothing is based on a weighted average: |
| + | |||
| + | <code cpp> | ||
| + | average = (weight_current * delta + weight_previous * average) / (weight_current + weight_preivous) | ||
| + | </ | ||
| + | |||
| + | where : | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | |||
| + | This average is calculated for each axis (x & y) separately. | ||
| + | |||
| + | The problem with a simple weighted average as above is that the user has to choose between a smooth but laggy movement ('' | ||
| + | |||
| + | The idea is then to change '' | ||
| + | * If the movement is slow, we keep '' | ||
| + | * If the movement is fast, '' | ||
| + | |||
| + | Internaly, the driver keeps the last 10 packets. Here is the simplified algorithm: | ||
| + | |||
| + | <code cpp> | ||
| + | dx = abs(new_x - older_x) + 1; /* +1: to avoid a division by zero below. */ | ||
| + | dy = abs(new_y - older_y) + 1; | ||
| + | |||
| + | /* " | ||
| + | len = (dx * dx) + (dy * dy); | ||
| + | |||
| + | /* " | ||
| + | * " | ||
| + | weight_previous = sysctl_weight_len_squared * weight_previous / len; | ||
| + | weight_previous = imin(weight_previous, | ||
| + | </ | ||
| + | |||
| + | The driver will do almost the same with the divisor to calculate the acceleration. The rest of the division is also kept between each packet; otherwise, with slow movements, the pointer doesn' | ||
| + | |||
| + | ==== Touchpad Borders (Margins) ==== | ||
| + | |||
| + | Touchpad edges (borders) can generate a lot of noise in reported coordinates. There are two sets of sysctl | ||
| < | < | ||
| Line 129: | Line 169: | ||
| </ | </ | ||
| - | '' | + | '' |
| - | ==== Points | + | ==== Points |
| < | < | ||
| Line 140: | Line 180: | ||
| '' | '' | ||
| - | ==== Tap and tap-hold ==== | + | ==== Tap and Tap-hold ==== |
| < | < | ||
| Line 155: | Line 195: | ||
| '' | '' | ||
| - | ==== Virtual | + | ==== Virtual |
| < | < | ||
| Line 167: | Line 207: | ||
| An area must be dedicated to virtual scrolling for now. This area is defined by '' | An area must be dedicated to virtual scrolling for now. This area is defined by '' | ||
| - | ===== How it works ===== | + | ===== Toggling Synaptics Touchpad with devd ===== |
| - | ==== Movement smoothing and tap-hold | + | Although touchpads can support |
| - | The smoothing is based on a weighted average: | + | These instructions assume |
| - | <code cpp> | + | ==== Setup ==== |
| - | average | + | |
| - | </ | + | |
| - | + | ||
| - | where : | + | |
| - | * '' | + | |
| - | * '' | + | |
| - | * '' | + | |
| - | + | ||
| - | This average is calculated for each axis (x & y) separately. | + | |
| - | + | ||
| - | The problem with a simple weighted average as above is that the user has to choose between a smooth but laggy movement ('' | + | |
| - | + | ||
| - | The idea is then to change '' | + | |
| - | * If the movement is slow, we keep '' | + | |
| - | * If the movement is fast, '' | + | |
| - | + | ||
| - | Internaly, the driver keeps the last 10 packets. Here is the simplified algorithm: | + | |
| - | + | ||
| - | <code cpp> | + | |
| - | dx = abs(new_x - older_x) + 1; /* +1: to avoid a division by zero below. */ | + | |
| - | dy = abs(new_y - older_y) + 1; | + | |
| - | + | ||
| - | /* " | + | |
| - | len = (dx * dx) + (dy * dy); | + | |
| - | + | ||
| - | /* " | + | |
| - | * " | + | |
| - | weight_previous = sysctl_weight_len_squared * weight_previous / len; | + | |
| - | weight_previous = imin(weight_previous, | + | |
| - | </ | + | |
| - | + | ||
| - | The driver will do almost the same with the divisor to calculate the acceleration. The rest of the division is also kept between each packet; otherwise, with slow movements, the pointer doesn' | + | |
| - | + | ||
| - | ===== Toggling synaptics with devd ===== | + | |
| - | + | ||
| - | Although there is some palm detection support for [[SynapticsTouchpad|synaptics touchpads]], | + | |
| - | + | ||
| - | These instructions will assume you are using a USB wired mouse or a wireless mouse using a tranceiver. For a mouse that connects via bluetooth, you will need to find your mouses device-name. | + | |
| - | + | ||
| - | ==== Installation | + | |
| We will be triggering a script from devd in order to toggle synaptics. | We will be triggering a script from devd in order to toggle synaptics. | ||
| Line 281: | Line 281: | ||
| Credit for scripted synpatics toggle via devd goes to SamuelGogarty. | Credit for scripted synpatics toggle via devd goes to SamuelGogarty. | ||
| + | |||
| + | ===== Other Resources ===== | ||
| + | |||
| + | * [[https:// | ||
| ---- | ---- | ||
| {{tag> | {{tag> | ||
| + | {{tag> | ||