Hikari9 / comfortable-swipe

Comfortable 3-finger and 4-finger swipe gesture using Xdotool in native C++
GNU General Public License v3.0
557 stars 46 forks source link

Operation not permitted on start, but only for one event #23

Open jbprat opened 6 years ago

jbprat commented 6 years ago

Hello and thank you for your work! I cannot wait to test it.

I am using Ubuntu 17.04 and followed your readme, when coming to the instruction to update permission, I had to modify it a beat to get it working by removing the $ in front of (. I also tried adding $USERto all the input successfully.

Problem is I still have an operation not permitted error when trying to start comfortable-swipe.

~> comfortable-swipe start
Failed to open /dev/input/event11 (Operation not permitted)
~> ls -l /dev/input/event*
crw-rw---- 1 root input 13, 64 Dec 30 09:32 /dev/input/event0
crw-rw---- 1 root input 13, 65 Dec 30 09:32 /dev/input/event1
crw-rw---- 1 root input 13, 74 Dec 30 09:32 /dev/input/event10
crw-rw---- 1 root input 13, 75 Dec 30 09:32 /dev/input/event11
crw-rw---- 1 root input 13, 76 Dec 30 09:32 /dev/input/event12
crw-rw---- 1 root input 13, 77 Dec 30 09:32 /dev/input/event13
crw-rw---- 1 root input 13, 78 Dec 30 09:32 /dev/input/event14
crw-rw---- 1 root input 13, 79 Dec 30 09:32 /dev/input/event15
crw-rw---- 1 root input 13, 66 Dec 30 09:32 /dev/input/event2
crw-rw---- 1 root input 13, 67 Dec 30 09:32 /dev/input/event3
crw-rw---- 1 root input 13, 68 Dec 30 09:32 /dev/input/event4
crw-rw---- 1 root input 13, 69 Dec 30 09:32 /dev/input/event5
crw-rw---- 1 root input 13, 70 Dec 30 09:33 /dev/input/event6
crw-rw---- 1 root input 13, 71 Dec 30 09:32 /dev/input/event7
crw-rw---- 1 root input 13, 72 Dec 30 09:32 /dev/input/event8
crw-rw---- 1 root input 13, 73 Dec 30 09:32 /dev/input/event9

Can you help me through it?

Hikari9 commented 6 years ago

Thanks! For the readme instruction, $ meant the following line is terminal input, which is pretty standard.

For your problem, I think you just need to reboot your computer and you're ready to go. Otherwise if it is still not working, maybe your touchpad doesn't support multi-touch? If it helps, can you tell me what touchpad driver you are using (e.g. Synaptic)

jbprat commented 6 years ago

Hi and thank you for the quick response! I restarsted the computer and still have the operation not permitted issue.

Here is the touchpad driver I'm using on my laptop:

⎡ Virtual core pointer                      id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ ETPS/2 Elantech Touchpad                  id=14   [slave  pointer  (2)]
⎜   ↳ Logitech M510                             id=12   [slave  pointer  (2)]
Hikari9 commented 6 years ago

That's weird, I'm also using Elantech driver (but in Ubuntu 16.04LTS). My guess is that it has something to do with a kernel in 17.04. I'm not sure if it will fix the issue, but it might be best to upgrade to 17.10, if you're okay with that?

suposh commented 6 years ago

Hello there, I am having the similar issues. When i run this command comfortable-swipe start
Failed to open /dev/input/event12 (Operation not permitted)

I am attaching my touchpad driver details too Virtual core pointer id=2 [master pointer (3)] ↳ Virtual core XTEST pointer id=4 [slave pointer (2)] ↳ SynPS/2 Synaptics TouchPad id=11 [slave pointer (2)]

I am using ubuntu 16.04 LTS .Also i have checked on the decsription page of my acer laptop that the trackpad supports "multitouch". Hence i request your help with this.

Hikari9 commented 6 years ago

Confirming this bug since it affects multiple users. I think this problem lies with libinput, specifically when you run libinput-debug-events in terminal.

Some things that can be of help, I saw a similar issue from another project (libinput-gestures). Please see if any of these solutions work:

  1. Try sudo chmod 664 /dev/input/event* then comfortable-swipe start.
    • If this is working, reboot then try comfortable-swipe start again without chmod. Can you tell me if it's working again or not? If it doesn't, this might be caused by some external program changing the permissions upon reboot (e.g. WhatPulse).
  2. Try with sudo comfortable-swipe start, is it working? How about sudo libinput-debug-events?
  3. Run libinput-list-devices to find out which touchpad device number is. Then run libinput-debug-events --device /dev/input/event#, replacing # with the touchpad device number. In my case, it's /dev/input/event14. Should look something like this:
    $ libinput-debug-events --device /dev/input/event14
    -event14  DEVICE_ADDED     Asus TouchPad                     seat0 default group1  cap:pg  size 70x50mm tap(dl off) left scroll-nat scroll-2fg-edge click-buttonareas-clickfinger dwt-on
    event14  POINTER_MOTION    +1.98s    0.00/ -0.18
    event14  POINTER_MOTION    +1.99s   -6.09/ -7.73
    event14  POINTER_MOTION    +1.99s   -5.46/ -7.91
    event14  POINTER_MOTION    +2.00s   -5.10/ -7.08
    event14  POINTER_MOTION    +2.01s   -4.01/ -5.83
    event14  POINTER_MOTION    +2.02s   -3.28/ -4.99
    event14  POINTER_MOTION    +2.02s   -2.55/ -4.58
    event14  POINTER_MOTION    +2.03s   -2.19/ -4.58
    event14  POINTER_MOTION    +2.04s   -2.19/ -4.99
    event14  POINTER_MOTION    +2.05s   -1.82/ -4.16

    Is it reading properly, or still permission denied?

suposh commented 6 years ago

Thanks for your quick Response.

I tried all the 3 points that you mentioned. So here i am posting the results of the points that you have mentioned

  1. Running sudo chmod 664 /dev/input/event* then comfortable-swipe start it still says Failed to open /dev/input/event14 (Operation not permitted)

2.Running sudo comfortable-swipe start i get the same error message Failed to open /dev/input/event14 (Operation not permitted)

`suposh@eclipse:~$ sudo libinput-debug-events Failed to open /dev/input/event14 (Operation not permitted) -event2 DEVICE_ADDED Power Button seat0 default group1 cap:k -event6 DEVICE_ADDED Video Bus seat0 default group2 cap:k

and Output of sudo libinput-debug-events is:

` suposh@eclipse:~$ sudo libinput-debug-events Failed to open /dev/input/event14 (Operation not permitted) -event2 DEVICE_ADDED Power Button seat0 default group1 cap:k -event6 DEVICE_ADDED Video Bus seat0 default group2 cap:k -event1 DEVICE_ADDED Sleep Button seat0 default group3 cap:k -event4 DEVICE_ADDED Logitech USB Receiver seat0 default group4 cap:p left scroll-nat scroll-button -event5 DEVICE_ADDED Logitech USB Receiver seat0 default group4 cap:kp scroll-nat -event12 DEVICE_ADDED HD WebCam seat0 default group5 cap:k -event3 DEVICE_ADDED AT Translated Set 2 keyboard seat0 default group6 cap:k -event7 DEVICE_ADDED SynPS/2 Synaptics TouchPad seat0 default group7 cap:p size 82x42mm tap(dl off) left scroll-nat scroll-2fg-edge dwt-on -event13 DEVICE_ADDED Acer WMI hotkeys seat0 default group8 cap:k -event3 KEYBOARD_KEY +0.90s (-1) pressed event3 KEYBOARD_KEY +2.55s (-1) pressed

`

3.Output of libinput-list-devices is: ` Device: SynPS/2 Synaptics TouchPad Kernel: /dev/input/event7 Group: 7 Seat: seat0, default Size: 81.61x41.97mm Capabilities: pointer Tap-to-click: disabled Tap-and-drag: enabled Tap drag lock: disabled Left-handed: disabled Nat.scrolling: disabled Middle emulation: n/a Calibration: n/a Scroll methods: *two-finger edge Click methods: none Disable-w-typing: enabled Accel profiles: none Rotation: n/a

`

suposh@eclipse:~$ libinput-debug-events --device /dev/input/event7 -event7 DEVICE_ADDED SynPS/2 Synaptics TouchPad seat0 default group1 cap:p size 82x42mm tap(dl off) left scroll-nat scroll-2fg-edge dwt-on Still Getting the same error message.

jbprat commented 6 years ago

Hi!

On my side, running sudo chmod 664 /dev/input/event* still gives me the same Operation not permitted error.

sudo comfortable-swipe startstill gives me the error.

When I type sudo libinput-debug-events, the first message is the Operation not permitted error, and this is the log when I swipe with three fingers:

event7   GESTURE_PINCH_BEGIN +12.01s    3
 event7   GESTURE_PINCH_UPDATE +12.01s  3 -5.72/-3.88 (-16.70/-11.33 unaccelerated)  0.99 @  0.66
 event7   GESTURE_PINCH_UPDATE +12.05s  3 -5.26/-2.63 (-21.47/-10.74 unaccelerated)  0.98 @  0.64
 event7   GESTURE_PINCH_UPDATE +12.09s  3 -7.74/-2.64 (-24.46/-8.35 unaccelerated)  0.97 @  0.49
 event7   GESTURE_PINCH_UPDATE +12.12s  3 -8.08/-2.84 (-22.07/-7.75 unaccelerated)  0.96 @  0.32
 event7   GESTURE_PINCH_UPDATE +12.14s  3 -3.97/-0.88 (-10.74/-2.39 unaccelerated)  0.97 @  0.83
 event7   GESTURE_PINCH_UPDATE +12.16s  3 -7.06/-4.42 (-19.09/-11.93 unaccelerated)  0.96 @  0.61

In my case, the touchpad is event7 and this is my log when I specifically choose this device, no error at all:

-event7   DEVICE_ADDED     ETPS/2 Elantech Touchpad          seat0 default group1  cap:pg  size 99x59mm tap(dl off) left scroll-nat scroll-2fg-edge click-buttonareas-clickfinger dwt-on
event7   GESTURE_SWIPE_BEGIN  +3.77s    3
 event7   GESTURE_SWIPE_UPDATE  +3.77s  3 -2.27/ 0.00 (-14.32/ 0.00 unaccelerated)
 event7   GESTURE_SWIPE_UPDATE  +3.78s  3 -2.01/ 0.00 (-8.75/ 0.00 unaccelerated)
 event7   GESTURE_SWIPE_UPDATE  +3.79s  3 -5.30/ 0.00 (-15.11/ 0.00 unaccelerated)
 event7   GESTURE_SWIPE_UPDATE  +3.80s  3 -4.71/ 0.00 (-12.73/ 0.00 unaccelerated)
 event7   GESTURE_SWIPE_UPDATE  +3.81s  3 -13.10/ 0.00 (-35.39/ 0.00 unaccelerated)
 event7   GESTURE_SWIPE_UPDATE  +3.82s  3 -7.36/ 0.00 (-19.88/ 0.00 unaccelerated)
 event7   GESTURE_SWIPE_UPDATE  +3.83s  3 -5.74/ 0.00 (-15.51/ 0.00 unaccelerated)
 event7   GESTURE_SWIPE_UPDATE  +3.84s  3 -2.65/ 0.00 (-7.16/ 0.00 unaccelerated)
 event7   GESTURE_SWIPE_UPDATE  +3.85s  3 -4.27/ 0.00 (-11.53/ 0.00 unaccelerated)
 event7   GESTURE_SWIPE_UPDATE  +3.86s  3 -1.91/ 0.00 (-5.17/ 0.00 unaccelerated)
 event7   GESTURE_SWIPE_UPDATE  +3.87s  3 -4.71/ 0.00 (-12.73/ 0.00 unaccelerated)
 event7   GESTURE_SWIPE_UPDATE  +3.88s  3 -2.21/-0.15 (-5.97/-0.40 unaccelerated)
 event7   GESTURE_SWIPE_UPDATE  +3.96s  3 -3.83/ 0.00 (-10.34/ 0.00 unaccelerated)
 event7   GESTURE_SWIPE_UPDATE  +3.97s  3 -2.06/-0.44 (-5.57/-1.19 unaccelerated)
 event7   GESTURE_SWIPE_END  +4.03s 3

I think I'm getting closer, because I don't see any dev/input/event11 in the list of devices!

Also, here is the output of my touchpad device:

Device:           ETPS/2 Elantech Touchpad
Kernel:           /dev/input/event7
Group:            8
Seat:             seat0, default
Size:             98.79x59.27mm
Capabilities:     pointer 
Tap-to-click:     disabled
Tap-and-drag:     enabled
Tap drag lock:    disabled
Left-handed:      disabled
Nat.scrolling:    disabled
Middle emulation: disabled
Calibration:      n/a
Scroll methods:   *two-finger edge 
Click methods:    *button-areas clickfinger 
Disable-w-typing: enabled
Accel profiles:   none
Rotation:         n/a
Hikari9 commented 6 years ago

@jbprat, based on your output, indeed the problem lies with comfortable swipe. I'm still trying to replicate it, so please wait for further updates.

EDIT: since you see GESTURE_SWIPE_XXX, comfortable swipe should work even with the error message. However, I cannot do anything about it since I (currently) have no way to know which event the touchpad is installed. I may provide a PR in the future.

@suposh, Does something similar to GESTURE_SWIPE_UPDATE appear during libinput-debug-events? If it doesn't appear, unfortunately that means your touchpad doesn't support 3-finger gestures.

Hikari9 commented 5 years ago

I'll try to fix the bug with the input having an install script with the removed $. I will reference this in the next PR, but I will keep this issue open as it is not yet fully solved.