1. 21 May, 2020 1 commit
    • Peter Hutterer's avatar
      Deprecate wheel tilt as separate axis source · 4ff6d6e3
      Peter Hutterer authored
      This has never been supported through the stack. No device ever had the
      required MOUSE_WHEEL_TILT_VERTICAL/HORIZONTAL udev property set, so
      libinput never set the right axis source. Neither weston nor mutter
      added the code for it. Even if we added wheel tilt for devices now, it
      would break those devices. And the benefit we get from having those
      separate is miniscule at best.
      
      So let's do the long-term thing and just deprecate this axis source.
      
      The wheel tilt mouse test device remains in the test suite, with the
      udev properties set just to verify that we do indeed ignore those now.
      Signed-off-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
      4ff6d6e3
  2. 20 Jan, 2020 1 commit
    • A. Wilcox's avatar
      evdev-fallback: Use input_event_init for fallback · ab377baa
      A. Wilcox authored
      Old-style field initialisation ignores the 64-bit time_t change in
      Linux UAPI, which causes the structure to be incompletely initialised
      on 32-bit systems with the 64-bit time_t kernel headers.
      
      This patch uses the input_event_init helper from the original 64-bit
      time_t enablement patch.
      Signed-off-by: A. Wilcox's avatarA. Wilcox <AWilcox@Wilcox-Tech.com>
      Fixes: 5dc1a7eb ("Adjust for 64bit time_t for 32bit architectures")
      See-Also: !346
      ab377baa
  3. 24 Oct, 2019 1 commit
  4. 17 Oct, 2019 1 commit
    • Peter Hutterer's avatar
      Add a scroll button lock feature · 63f99230
      Peter Hutterer authored
      Scroll button locking is an accessibility feature. When enabled, the scroll
      button does not need to be held down, the first click holds it logically down,
      to be released on the second click of that same button.
      
      This is implemented as simple event filter, so we still get the same behavior
      from the emulated logical button, i.e. a physical double click results in a
      single logical click of that button provided no scrolling was triggered.
      Signed-off-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
      63f99230
  5. 16 Oct, 2019 1 commit
  6. 28 May, 2019 1 commit
    • Peter Hutterer's avatar
      quirks: add trackpoint integration attribute · 8dfe8c68
      Peter Hutterer authored
      Some versions [1] of the Lenovo ThinkPad Compact USB Keyboard with TrackPoint USB
      have the pointing stick on an event node that has keys but is not a regular
      keyboard. Thus the stick falls through the cracks and gets disabled on tablet
      mode switch. Instead of adding more hacks let's do this properly: tag the
      pointing stick as external and have the code in place to deal with that.
      
      [1] This may be caused by recent kernel changes
      
      Fixes #291
      Signed-off-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
      8dfe8c68
  7. 26 May, 2019 1 commit
  8. 11 Apr, 2019 1 commit
    • Jason Gerecke's avatar
      fallback: Fix ubsan runtime error · f589f496
      Jason Gerecke authored
      Running libinput-test-suite with -fsanitize=undefined highlights the two
      following errors. Force C to realize we want an unsigned result by making
      the '1' literal unsigned.
      
      ../src/evdev-fallback.c:314:22 runtime error: left shift of 1 by 31 places cannot be represented in type 'int'
      ../src/evdev-fallback.c:377:24 runtime error: left shift of 1 by 31 places cannot be represented in type 'int'
      
      v2: use bit() instead of manual shift 1U<<1
      Signed-off-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
      f589f496
  9. 04 Mar, 2019 1 commit
  10. 11 Feb, 2019 2 commits
  11. 05 Feb, 2019 1 commit
  12. 31 Jan, 2019 6 commits
    • Peter Hutterer's avatar
      tablet: add tilt-based touch arbitration for screen tablets · f612c1ef
      Peter Hutterer authored
      If the tilt angle on tip down is not 0 set the touch arbitration to a
      rectangle around the assumed position of the hand. This assumed position is
      right of the tip for a rightwards tilt and left of the tip for a leftwards
      tilt (i.e. left-handed mode). The rectangle is 200x200mm with a 20x50mm
      NW of the tip or NE for left-handed. In other words, if the period below is
      the tip, the rectangle looks like this:
      
          +-----------+                          +-----------+
          | . 	| <- for rightwards tilt   |         . |
          |           |                          |           |
          |           |                          |           |
          |           |    for leftwards tilt -> |           |
          +-----------+                          +-----------+
      
      Touches within that rectangle are canceled, new touches are ignored. As the
      tip moves around the rectangle is updated but touches are only cancelled on
      the original tip down. While the tip is down, new touches are ignored in the
      exclusion area but pre-existing touches are not cancelled.
      
      This is currently only implemented in the fallback interface, i.e. it will
      only work for Cintiqs.
      Signed-off-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
      f612c1ef
    • Peter Hutterer's avatar
      evdev: add a rectangle to the touch arbitration · f325ca92
      Peter Hutterer authored
      This enables us to specify the location that needs to be arbitrated, rather
      than just disabling the whole device altogether. This patch just adds the
      hooks, no implementation.
      
      This is internal API only, one backend can specify an area in mm which gets
      converted to device coordinates in the target device and arbitrated there.
      Right now, everything simply passes NULL.
      Signed-off-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
      f325ca92
    • Peter Hutterer's avatar
      fallback: force the palm state to PALM_NONE on touch begin · 72560e03
      Peter Hutterer authored
      If we don't have tool-based palm detection, make sure our touch is labelled as
      "not palm" during touch down. Otherwise that slot remains on palm forever if
      it gets tagged as palm through some other means.
      
      This currently has no effect, nothing in the code would label the touch as
      palm. This is prep work for better touch arbitration.
      Signed-off-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
      72560e03
    • Peter Hutterer's avatar
      evdev: introduce a touch arbitration enum · d3595908
      Peter Hutterer authored
      This enables us to change the types of touch arbitration, with the focus on
      allowing location-based touch arbitration as well as the more generic "disable
      everything".
      Signed-off-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
      d3595908
    • Peter Hutterer's avatar
      fallback: add timer-based touch arbitration · ab1dbcc9
      Peter Hutterer authored
      When a hand is resting on a pen+touch device, lifting the hand may remove the
      stylus from proximity before the hand leaves the surface. If the kernel
      performs touch arbitration, this triggers a touch down on proximity out,
      followed by a touch up immediately after when the hand stops touching.
      
      This can cause ghost touch events. Prevent this by using a timer-based
      arbitration toggle.
      
      Same as 2a378bea but for the fallback
      interface.
      Signed-off-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
      ab1dbcc9
    • Peter Hutterer's avatar
      fallback: when force-releasing keys, release them directly · c75c00da
      Peter Hutterer authored
      An emulated button is recorded as BTN_MIDDLE in the key down mask. If the
      device is removed in that state, the BTN_MIDDLE event processed triggers
      an assertion when we try to send out the event twice.
      
      Fixes #201
      Signed-off-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
      c75c00da
  13. 27 Sep, 2018 1 commit
  14. 20 Sep, 2018 1 commit
  15. 26 Aug, 2018 1 commit
  16. 03 Aug, 2018 3 commits
  17. 02 Aug, 2018 2 commits
  18. 29 Jun, 2018 1 commit
  19. 29 May, 2018 2 commits
  20. 25 Apr, 2018 1 commit
  21. 18 Apr, 2018 1 commit
  22. 16 Apr, 2018 1 commit
  23. 08 Mar, 2018 1 commit
    • Peter Hutterer's avatar
      fallback: fix touchscreen defuzzing · 50418a01
      Peter Hutterer authored
      The hysteresis-returned point always differs from the current point, even if
      the hysteresis kicks in. We need to compare to the hysteresis center.
      
      And the returned point is only the new center if we exceed the margin,
      otherwise the center stays as-is.
      
      The touch_fuzz() test only succeeded for this because for the values we were
      introducing jitter by, the kernel filtered out all the actual movement so
      these paths weren't hit.
      Signed-off-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
      50418a01
  24. 05 Mar, 2018 1 commit
  25. 21 Feb, 2018 1 commit
  26. 23 Jan, 2018 1 commit
  27. 08 Dec, 2017 1 commit
    • Peter Hutterer's avatar
      fallback: send key events out immediately upon receiving them · 1c863692
      Peter Hutterer authored
      Commit db3b6fe5 "fallback: change to handle the state at EV_SYN time"
      introduced regressions for two types of event sequences.
      
      One is a kernel bug - some devices/drivers like the asus-wireless send a key
      press + release within the same event frame which now cancels out and
      disappears into the ether. This should be fixed in the kernel drivers but
      there appear to be enough of them that we can't just pretend it's an outlier.
      
      The second issue is a libinput bug. If we get two key events in the same frame
      (e.g. shift + A) we update the state correctly but the events are sent in the
      order of the event codes. KEY_A sorts before KEY_LEFTSHIFT and our shift + A
      becomes A + shift.
      
      Fix this by treating key events as before db3b6fe5 - by sending them out
      as we get them.
      
      https://bugs.freedesktop.org/show_bug.cgi?id=104030Signed-off-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
      1c863692
  28. 19 Nov, 2017 3 commits
    • Peter Hutterer's avatar
      evdev: add new debouncing code · de994d13
      Peter Hutterer authored
      The current debouncing code monitors events and switches on when events are
      too close together. From then on, any event can be delayed.
      
      Vicente Bergas provided an algorithm that avoids most of these delays:
      on a button state change we now forward the change without delay but start a
      timer. If the button changes state during that timer, the changes are
      ignored. On timer expiry, events are sent to match the hardware state
      with the client's view of the device. This is only done if needed.
      
      Thus, a press-release sequence of: PRP sends a single press event, a sequence of
      PRPR sends press and then the release at the end of the timeout. The timeout
      is short enough that the delay should not be noticeable.
      
      This new mode is called the 'bounce' mode. The old mode is now referred to as
      'spurious' mode and only covers the case of a button held down that loses
      contact. It works as before, monitoring a button for these spurious contact
      losses and switching on. When on, button release events are delayed as before.
      
      The whole button debouncing moves to a state machine which makes debugging a
      lot easier. See the accompanying SVG for the diagram.
      Signed-off-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
      de994d13
    • Peter Hutterer's avatar
      fallback: change to handle the state at EV_SYN time · db3b6fe5
      Peter Hutterer authored
      The previous approach was to remember the last event and flush it at the right
      time. The new approach is to update the device state during the frame and send
      out the events at EV_SYN time.
      
      This gives us two advantages: we are not dependent on the kernel order of how
      events come in and we can process events depending on other events in the same
      frame. This will come in handy later for button debouncing.
      
      This is also the approach we have in the touchpad and tablet backends.
      
      Two FIXMEs are left in place, the button debouncing code and the lid switch
      code. Both need to be handled in future patches.
      Signed-off-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
      db3b6fe5
    • Peter Hutterer's avatar
      fallback: create the evdev-fallback.h header file · 87920f49
      Peter Hutterer authored
      So we can split up evdev-fallback.c into multiple files where needed.
      Signed-off-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
      87920f49