summaryrefslogtreecommitdiff
path: root/src/synapticsstr.h
AgeCommit message (Collapse)AuthorFilesLines
2024-05-12Raise minimum supported Xserver version from 1.12 to 1.15Alan Coopersmith1-16/+0
Drops support for ABI_XINPUT_VERSION < 20, including removing support for driver-side coordinate scaling, since the X server handles it now. Xserver 1.15 was released in Dec. 2013. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2024-01-05Handle 5 -Wmissing-prototypes warningsAlan Coopersmith1-0/+4
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-01-16Fix spelling/wording issuesAlan Coopersmith1-2/+2
Found by using: codespell --builtin clear,rare,usage,informal,code,names Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2016-09-15Remove unused fraction calculationsPeter Hutterer1-1/+0
hw.x and the motion history are integers so our deltas are always integers. It's a bit pointless to split them into the fractional and integral part. obsolete since defc1d008e5674306a or so Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-06-02Support XINPUT ABI version 23Peter Hutterer1-0/+4
Use input_lock/input_unlock calls instead of SIGIO functions Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-03-18Revert "Support the new Lenovo X1 Carbon 3rd trackpoint buttons"Peter Hutterer1-2/+0
This reverts commit 064445364b4775b25ba49c2250b22b169f291147. The Lenovo *50 series, including the X1 Carbon 3rd always require multiple kernel patches to enable the touchpad buttons. This patch in synaptics only addresses the re-routing of the top buttons. The final iteration of the kernel patches also route the trackpoint buttons through the trackpoint device, rendering this patch unnecessary. These patches are queued for 4.0. See kernel patch series up to commit cdd9dc195916ef5644cfac079094c3c1d1616e4c Author: Benjamin Tissoires <benjamin.tissoires@redhat.com> Date: Sun Mar 8 22:35:41 2015 -0700 Input: synaptics - re-route tracksticks buttons on the Lenovo 2015 series Currently in Dmitry's for-linus branch. Distributions running older kernels or the kernel stable series which has partial backports of the above patch series are encouraged to leave the 0644453 commit in and undo this revert. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-02-18Add a delay between the second button down-up event of double tapsGabriele Mazzotta1-1/+0
Some applications ignore the second tap of double taps because of the lack of a delay between the button down and button up events. Prevent this by replacing the transition from TS_2B to TS_START with a transition from TS_2B to TS_SINGLETAP that emits only a button down event. The button up event will be emitted when transitioning from TS_SINGLETAP to TS_START. In addition, decrease the default value of MaxDoubleTapTime from 180 ms to 100 ms in order to make double taps faster. Signed-off-by: Gabriele Mazzotta <gabriele.mzt@gmail.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-01-30Support the new Lenovo X1 Carbon 3rd trackpoint buttonsPeter Hutterer1-0/+2
This device has the trackpoint buttons wired up to the touchpad to send BTN_0, BTN_1 and BTN_2 for left, right, middle. This conflicts with previous touchpads that used those event codes for dedicated scroll buttons. Add an option HasTrackpointButtons that can be set via a xorg.conf.d snippets. This option is not intended as a user-set option, rather we expect distributions to ship some conglomerate of udev/hal rules with xorg.conf snippets that take effect. If the option is set, we look at the three affected buttons at the beginning of HandleState and send button events immediately for them. The HW state is reset to neutral and other processing continues. This saves us from having to synchronize these buttons with software buttons (also present on this device), tapping, etc. Since the buttons are physically different and (mentally) associated with the trackpoint device we also don't need to worry about having finger motion event correctly synced up with the button presses - it's acceptable to send the presses before the motion events. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Tested-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2015-01-08Don't assume that touch devices report per finger width and pressureGabriele Mazzotta1-0/+1
The palm detection relies on both the width and the pressure. a897147be04 ("Use ABS_MT events for the palm detection when supported") assumed that all the touch devices can report both ABS_MT_TOUCH_MAJOR and ABS_MT_PRESSURE, but this is not necessarily true. This assumption could hence break the palm detection when at least one of the mentioned events is not declared but both ABS_TOOL_WIDTH and ABS_PRESSURE are reported. Signed-off-by: Gabriele Mazzotta <gabriele.mzt@gmail.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-09-17Limit the movement to 20 mm per eventPeter Hutterer1-0/+2
Touchpads are limited by a fixed sampling rate (usually 80Hz). Some finger changes may happen too fast for this sampling rate, resulting in two distinct event sequences: * finger 1 up and finger 2 down in the same EV_SYN frame. Synaptics sees one finger down before and after and the changed coordinates * finger 1 up and finger 2 down _between_ two EV_SYN frames. Synaptics sees one touchpoint move from f1 position to f2 position. That move causes a large cursor jump. The former could be solved (with difficulty) by adding fake EV_SYN handling after releasing touchpoints but that won't fix the latter case. So as a solution for now limit the finger movement to 20mm per event. Tests on a T440 and an x220 showed that this is just above what a reasonable finger movement would trigger. If a movement is greater than that limit, reset it to 0/0. On devices without resolution, use 0.25 of the touchpad's diagonal instead. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-04-30Add support for INPUT_PROP_TOPBUTTONPADHans de Goede1-0/+1
Add a HasSecondaryButtons boolean config option which defaults to true for devices with the INPUT_PROP_TOPBUTTONPAD and false for all other devices. Only parse the SecondarySoftButtonAreas when this option is true, effectively disabling the top buttons when it is false. Likewise, only initialize the SecondarySoftButtonAreas property if we enable support for it. This means that it is now safe to always set a SecondarySoftButtonAreas default in 50-synaptics.conf, and that he section which was intended for use with future pnp-id matching can be dropped, as that is now all handled in the kernel. While at also remove the comment about disabling the bottom edge area, as that is now done automatically. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-03-12Revert "Add another third state to TouchpadOff for disabling all but button ↵Peter Hutterer1-2/+0
clicks" This third state is not needed, the behaviour of the touchpad driver is now good enough to not need an external syndaemon instance to toggle this third state. This reverts commit eea73358760c7ff9c9dac061f265753637c6f25c. Conflicts: man/synaptics.man src/synaptics.c Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-03-12Replace is_inside_anybutton_area with current_button_areaStephen Chandler Paul1-1/+2
Signed-off-by: Stephen Chandler Paul <thatslyude@gmail.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-03-11Add property support for secondary (top) software buttonsPeter Hutterer1-0/+16
This was originally intended as a fixed xorg.conf option only (and still largely is seen as such). Secondary software button are required only on a specific series of touchpads and should be pre-configured by the system and/or the distribution. As such, the property will not be initialized if it is not set in the xorg.conf and will thus not respond to runtime changes. Exposing the property in this way gives clients a chance of detecting if a top software button area is present and thus adjust their behaviour accordingly. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-02-26Ignore motion the first X ms after a clickpad clickHans de Goede1-0/+2
This fixes my #1 anoyance with clickpads, where 2 out of 3 clicks turn into a click + drag unless I hold my finger really really still. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Replaced property with a hardcoded 100ms. This is not something that we should expose as property, we should find a delay that works best and live with it. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-02-26Don't report motion inside soft-button areasHans de Goede1-0/+1
Unless the motion has started outside the soft-button area. Note that we must start reporting motions regardless of whether we think we're in the button area or not as soon as we've switched to using cumulative coordinates, since then the coordinates are no longer absolute. This fixes the reporting of unintended motion just before a click in a soft button area which sometimes causes mis-clicks. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-02-26Get rid of old_hw_stateHans de Goede1-1/+0
We only use it to store button state which we already have in priv->lastButtons. While at it also properly indent the code block checking the various soft button areas. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-02-24Add another third state to TouchpadOff for disabling all but button clicksPeter Hutterer1-0/+2
On a new set of laptops like the Lenovo T440 the trackstick does not have physical buttons. Instead, the touchpad's top edge is supposed to acts software button area. To avoid spurious cursor jumps when the trackstick is in use and the finger is resting on the touchpad, add another mode that disables motion events. Enabled by syndaemon with -t click-only, the default stays unchanged. No specific integration with the traditional disable-while-typing is needed. On such touchpads, disabling motion events is sufficient to avoid spurious events and we don't want to stop HW buttons to send events. Note that this only adds the new state to the driver and to syndaemon, there is nothing hooked up otherwise to actually monitor the trackstick. Special note for syndaemon: optional arguments are a GNU extension, so work around it by messing with an optstring starting with ":" which allows us to manually parse the options. Original version of this patch by John Pham <jhnphm@gmail.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-02-21Add secondary (top) software buttons areaBenjamin Tissoires1-1/+1
New generation of laptops with trackstick do not have physical buttons associated with the trackstick, but instead rely on software buttons at the top of the clickpad. Adding a secondary software button area for this purpose. As we're likely detecting the devices that need it based on udev tags and MatchTag configuration items, this area doesn't need to be exposed through properties. So static configuration is fine. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> [couple of man-page additions and rewrites] Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-02-18Revert "Drop circular pad support"Peter Hutterer1-0/+1
This reverts commit 3b02e7fd81da4b100fb9ac32378f6d50f54cf0e2. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Conflicts: man/synaptics.man src/synaptics.c Acked-by: Daniel Stone <daniel@fooishbar.org>
2014-01-17Revert "Purge scrollbuttons (repeat)"Peter Hutterer1-1/+13
This reverts commit 0903d99ada1755f11a2a5cbf89a345de896e18ec. Scroll buttons are still present in some modern devices, e.g. the Fujitsu Lifebook E782 and others in the series. Conflicts: include/synaptics.h man/synaptics.man src/synaptics.c
2014-01-03Fix ABI detection for in-driver scalingPeter Hutterer1-3/+3
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-07-19Disable driver scaling for input ABI 19.2Peter Hutterer1-0/+10
For absolute devices in relative mode, i.e. touchpads, the server now takes device resolution into account. Doing so means that the driver mustn't scale, so we deactivate those bits in the driver. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-01-31Replace numerical values with an enum for the TouchpadOff propPeter Hutterer1-0/+6
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-08-10Use LogMessageVerbSigSafe on ABI 18Peter Hutterer1-0/+4
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2012-06-12Add MODEL_UNIBODY_MACBOOK touchpad model for bcm5974 devicesChase Douglas1-1/+2
Initially, treat them the same as MODEL_APPLETOUCH devices, as that is what they were recognized as before. Signed-off-by: Chase Douglas <chase.douglas@canonical.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-06-05Remove leftover HAVE_SMOOTH_SCROLL typedefPeter Hutterer1-4/+0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2012-06-05Move properties header to where it's neededPeter Hutterer1-1/+0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2012-05-31Remove typedefs from all enumsPeter Hutterer1-4/+4
We currently mix non-typedef'd and typedef'd enums in the code. Stop this mixing, remove typedefs to make the code more obvious. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2012-05-18Remove absolute modePeter Hutterer1-1/+0
Moving a touchpad in absolute mode is unusual - touchpads are disconnected from the output device, so direct interaction is hard. There appears to be little usage of it (I haven't seen bug reports from people claiming to use it). Joe Shaw, author of the code and only known user doesn't have a use for it anymore, so purge it from the repo. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2012-05-11Fix coasting speed triggerPeter Hutterer1-3/+3
CoastingSpeed is defined as scrolls/s. The previous code just used delta/seconds which depended on the device coordinate range and exceeded the default CoastingSpeed at almost any scroll event. Divide the estimated delta by the scroll distance to get the accurate scrolls/s number. Since that now changes the contents of what's in coast_speed_y, change the users of that too. http://bugzilla.redhat.com/813686 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-05-10Move synaptics.h leftovers to synapticsstr.h, drop synaptics.hPeter Hutterer1-0/+20
This leaves us with a duplicated define for the maxbuttons but I'll live with that for now. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Chase Douglas <chase.douglas@canonical.com>
2012-05-10Require xserver 1.12 and inputproto 2.2Peter Hutterer1-8/+0
This drops conditional compilation of multitouch support, smooth scrolling support and old ABIs. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Chase Douglas <chase.douglas@canonical.com>
2012-05-10Drop circular pad supportPeter Hutterer1-1/+0
Do such devices still exist? Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Chase Douglas <chase.douglas@canonical.com>
2012-05-10Purge scrollbuttons (repeat)Peter Hutterer1-9/+1
I doubt devices that have scrollbuttons are still manufactured. Having untested code around is just asking for trouble. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Chase Douglas <chase.douglas@canonical.com>
2012-05-10Purge edge motionPeter Hutterer1-5/+0
A funny feature, but unreliable and mostly untested. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Chase Douglas <chase.douglas@canonical.com>
2012-05-10Purge fast-taps optionPeter Hutterer1-1/+0
This driver has too many options, maintaining them is hard and testing virtually doesn't happen. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Chase Douglas <chase.douglas@canonical.com>
2012-05-10Drop trackstick emulation modePeter Hutterer1-4/+0
"Trackstick emulation mode? That exists?" I hear you say? Yes, indeed. Well, no, not anymore. This driver is already unmaintainable without features like this. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Chase Douglas <chase.douglas@canonical.com>
2012-05-10Bury shm - or what was left of itPeter Hutterer1-4/+0
SHM configuration was removed in Apr 2009 (c09a3d50e9), since then it has only been usedful for debugging. And we have better tools (evtest) for debugging hardware events. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Chase Douglas <chase.douglas@canonical.com>
2012-05-10Indent consistentlyPeter Hutterer1-183/+178
x-indent-all.sh from xorg/util/modular as of c2d630fab65dbe3409af3947f6f442782ddb026f Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2012-04-11Replace hardcoded max number of touches with a define.Peter Hutterer1-0/+1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2012-03-22Fix clickfinger actions when middle button emulation is enabledChase Douglas1-1/+1
When MBE is enabled, a physical left button press is delayed until a timeout is reached. This results in the logical left button being depressed while the physical left button is pressed. The physical state is stored as the "old" hw state, and it is used for detecting a transition from depressed to pressed for clickfinger actions. Since the "old" hw state shows the left button pressed, but the current logical state shows the left button unpressed, when the MBE timeout fires and we set the logical left button pressed the transition check fails. Since the "old" hw state is only used for clickfinger left button press transitions, redefining it to hold the previous logical hw state is sufficient for fixing the bug and should not cause any regressions. Signed-off-by: Chase Douglas <chase.douglas@canonical.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-03-14Add soft button areas propertyChase Douglas1-0/+1
Some clickpad devices have button areas painted on them. Set this property to the area of the right and middle buttons to enable proper click actions when clicking in the areas. Signed-off-by: Chase Douglas <chase.douglas@canonical.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-03-14Calculate touch data for semi-mt devices, but don't send touch eventsChase Douglas1-0/+1
Previously, all touch data from semi-mt devices was ignored because the X server doesn't support them. However, the touch data must be used for proper clickpad handling. Instead of ignoring semi-mt device touch events, mark the device as being semi-mt and allow initialization of the touch state. The touches will then be used in calculating the cumulative_d{x,y} values that are needed for clickpad support. When handling the touch data for X event processing, simply skip over reporting the touches. Signed-off-by: Chase Douglas <chase.douglas@canonical.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-03-14Enable clickpad click and drag with two fingersChase Douglas1-1/+2
Use cumulative relative touch motion when the clickpad is pressed. If more than one touch is active, assume one of the touches is designated solely for pressing the clickpad button. Thus, decrement the number of reported touches. Signed-off-by: Chase Douglas <chase.douglas@canonical.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-03-14Add clickpad device propertyChase Douglas1-0/+1
Add it as a writable device property. We may not know how to probe some clickpads so allow the user to override it. Signed-off-by: Chase Douglas <chase.douglas@canonical.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-03-14Add an old_hw_state field to remember the last valuesPeter Hutterer1-0/+1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2012-03-13Fix build error - duplicate typedef (#47168)Peter Hutterer1-2/+2
Introduced in c34cf307f9982b62c6e6dfa2687e1b16f527f2a4. synapticsstr.h includes synproto.h, which now contains the typedef. X.Org Bug 47168 <http://bugs.freedesktop.org/show_bug.cgi?id=47168> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2012-03-05Implement a workaround for Elantech touchpadsPeter Zotov1-1/+2
All Elantech touchpads report the number of fingers explicitly, and at least the v3 version of the hardware can report any pressure values down to zero. This interferes with the tap detection hysteresis, which is required for dumb touchpads. This commit implements a vendor-specific workaround for Elantech touchpads which sets the FingerLow and FingerHigh options to 1 by default, effectively disabling the hysteresis mechanism. Signed-off-by: Peter Zotov <whitequark@whitequark.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2012-02-11Move X touch event processing into synaptics.cChase Douglas1-0/+1
Signed-off-by: Chase Douglas <chase.douglas@canonical.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>