devilhorns pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=8ebf4cd972674406b1fbfc497617996f1d7f4462

commit 8ebf4cd972674406b1fbfc497617996f1d7f4462
Author: Chris Michael <cp.mich...@samsung.com>
Date:   Thu Dec 8 14:30:41 2016 -0500

    elput: Improve checks for keyboard & pointer devices
    
    Some devices reported by libinput show up as both keyboard and mouse,
    even tho they are physically only just a keyboard or just a mouse.
    When a device gets added, we can verify if it is actually a mouse by
    checking if the device has BTN_LEFT (and for keyboards, check
    KEY_ENTER). This stops us from getting multiple mouse pointers
    reported when we really only have one.
    
    @fix
    
    Signed-off-by: Chris Michael <cp.mich...@samsung.com>
---
 src/lib/elput/elput_evdev.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/lib/elput/elput_evdev.c b/src/lib/elput/elput_evdev.c
index 1b0ca1b..d191f49 100644
--- a/src/lib/elput/elput_evdev.c
+++ b/src/lib/elput/elput_evdev.c
@@ -1239,13 +1239,15 @@ _evdev_device_create(Elput_Seat *seat, struct 
libinput_device *device)
    edev->seat = seat;
    edev->device = device;
 
-   if (libinput_device_has_capability(device, LIBINPUT_DEVICE_CAP_KEYBOARD))
+   if ((libinput_device_has_capability(device, LIBINPUT_DEVICE_CAP_KEYBOARD)) 
&&
+       (libinput_device_keyboard_has_key(device, KEY_ENTER)))
      {
         _keyboard_init(seat, seat->manager->cached.keymap);
         edev->caps |= EVDEV_SEAT_KEYBOARD;
      }
  
-   if (libinput_device_has_capability(device, LIBINPUT_DEVICE_CAP_POINTER))
+   if ((libinput_device_has_capability(device, LIBINPUT_DEVICE_CAP_POINTER) &&
+       (libinput_device_pointer_has_button(device, BTN_LEFT))))
      {
         _pointer_init(seat);
         edev->caps |= EVDEV_SEAT_POINTER;

-- 


Reply via email to