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 14:10] – First cut proof read and improvements 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 ===== | ||
| Line 14: | Line 16: | ||
| * Virtual scrolling. For now, an area must be dedicated to virtual scrolling; typically, one on the right (vertical scrolling) and one at the bottom (horizontal scrolling). Also, a patch must be applied to xf86-input-mouse to handle horizontal scrolling from sysmouse. Later, virtual scrolling with two fingers will be re-added, as found on Apple %%MacBook%%. | * Virtual scrolling. For now, an area must be dedicated to virtual scrolling; typically, one on the right (vertical scrolling) and one at the bottom (horizontal scrolling). Also, a patch must be applied to xf86-input-mouse to handle horizontal scrolling from sysmouse. Later, virtual scrolling with two fingers will be re-added, as found on Apple %%MacBook%%. | ||
| - | ===== How to use it ===== | + | ===== Setup ===== |
| To enable psm(4) Synaptics support, add the following line to '' | To enable psm(4) Synaptics support, add the following line to '' | ||
| Line 46: | Line 48: | ||
| </ | </ | ||
| - | ===== sysctl documentation | + | ===== Touchpad Configuration |
| ==== Palm Detection ==== | ==== Palm Detection ==== | ||
| 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 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 166: | Line 206: | ||
| 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 ===== | ||
| - | |||
| - | ==== Movement smoothing and tap-hold support ==== | ||
| - | |||
| - | 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' | ||
| ===== Toggling Synaptics Touchpad with devd ===== | ===== Toggling Synaptics Touchpad with devd ===== | ||
| - | Although | + | Although |
| - | These instructions assume | + | These instructions assume a USB wired or wireless mouse. For a mouse that connects via Bluetooth, you will also need to identify your mouse '' |
| - | ==== Installation | + | ==== Setup ==== |
| 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> | ||