Skip to content
This repository has been archived by the owner on Aug 20, 2023. It is now read-only.

Tap and hold do nothing #13

Open
HritwikSinghal opened this issue Mar 21, 2021 · 9 comments
Open

Tap and hold do nothing #13

HritwikSinghal opened this issue Mar 21, 2021 · 9 comments

Comments

@HritwikSinghal
Copy link

Distribution: Manjaro 20.2 Nibia, Wayland, Gnome.

my config;

swipe:
  3:
    left:
      sendkey: "LEFTALT+RIGHT" # history back
      keypress:
        LEFTCTRL:
          sendkey: "PREVIOUSSONG"
        # LEFTMETA+LEFTALT:
          # sendkey: 'BRIGHTNESSDOWN'

    right:
      sendkey: "LEFTALT+LEFT" # history forward
      keypress:
        LEFTCTRL:
          sendkey: "NEXTSONG"
        # LEFTMETA+LEFTALT:
        #   sendkey: 'xdotool key --clearmodifiers XF86AudioLowerVolume'

    up:
      sendkey: "LEFTMETA" # Overview
      keypress:
        LEFTCTRL:
          sendkey: "LEFTCTRL+K" # open new tab
        LEFTCTRL+LEFTALT:
          sendkey: 'BRIGHTNESSUP'

    down:
      sendkey: "LEFTMETA" # Overview
      keypress:
        LEFTCTRL:
          sendkey: "LEFTCTRL+COMMA" # close tab
        LEFTCTRL+LEFTALT:
          sendkey: 'BRIGHTNESSDOWN'

  4:
    left:
      sendkey: "VOLUMEDOWN"
    right:
      sendkey: "VOLUMEUP"
#     up:
#       sendkey: "xdotool key ctrl+alt+Down" # Switch to next workspace
#     down:
#       sendkey: "xdotool key ctrl+alt+Up" # Switch to previous workspace
pinch:
  in:
    sendkey: "ZOOMOUT" # Zoom in
  out:
    sendkey: "ZOOMIN" # Zoom out


threshold:
  pinch: 0.4
  swipe: 0.2

interval:
  swipe: 0.8
  pinch: 0.5
  tap: 0.2

tap:
1:
  sendkey: "echo ----------------tap1----------------------------"
  # 2:
  #   sendkey: "echo ----------------tap2----------------------------"
  # 3:
    # sendkey: "echo ----------------tap3----------------------------"
  # 4:
    # sendkey: "PLAYPAUSE"

hold:
#   1:
#     command: "echo ----------------hold1----------------------------"
#   2:
#     command: "echo ----------------hold2----------------------------"
#   3:
#     command: "echo ----------------hold3----------------------------"
  4:
    sendkey: "PLAYPAUSE"

plugin:
  inputs:
    libinput_command_input:
      enable-tap: true
      verbose: true
      show-keycodes: true

Details of fusuma

    ~  fusuma                                                                                                             ✔ 
I, [2021-03-21T05:46:22.426018 #81200]  INFO -- : reload config: /home/hritwik/.config/fusuma/config.yml
I, [2021-03-21T05:46:22.474143 #81200]  INFO -- : ---------------------------------------------
I, [2021-03-21T05:46:22.474180 #81200]  INFO -- : Fusuma: 1.11.1
I, [2021-03-21T05:46:22.475746 #81200]  INFO -- : libinput: 1.17.0
I, [2021-03-21T05:46:22.476284 #81200]  INFO -- : OS: Linux 5.11.6-1-MANJARO #1 SMP PREEMPT Thu Mar 11 19:05:51 UTC 2021
I, [2021-03-21T05:46:22.476807 #81200]  INFO -- : Distribution: Manjaro Linux \r  (\n) (\l)
I, [2021-03-21T05:46:22.479360 #81200]  INFO -- : Desktop session: gnome wayland
I, [2021-03-21T05:46:22.479387 #81200]  INFO -- : ---------------------------------------------
I, [2021-03-21T05:46:22.479399 #81200]  INFO -- : Enabled Plugins: 
I, [2021-03-21T05:46:22.479460 #81200]  INFO -- :   Fusuma::Plugin::Buffers::GestureBuffer
I, [2021-03-21T05:46:22.479473 #81200]  INFO -- :   Fusuma::Plugin::Buffers::KeypressBuffer
I, [2021-03-21T05:46:22.479482 #81200]  INFO -- :   Fusuma::Plugin::Buffers::TapBuffer
I, [2021-03-21T05:46:22.479490 #81200]  INFO -- :   Fusuma::Plugin::Detectors::KeypressDetector
I, [2021-03-21T05:46:22.479498 #81200]  INFO -- :   Fusuma::Plugin::Detectors::PinchDetector
I, [2021-03-21T05:46:22.479506 #81200]  INFO -- :   Fusuma::Plugin::Detectors::RotateDetector
I, [2021-03-21T05:46:22.479513 #81200]  INFO -- :   Fusuma::Plugin::Detectors::SwipeDetector
I, [2021-03-21T05:46:22.479524 #81200]  INFO -- :   Fusuma::Plugin::Detectors::TapDetector
I, [2021-03-21T05:46:22.479536 #81200]  INFO -- :   Fusuma::Plugin::Events::Records::GestureRecord
I, [2021-03-21T05:46:22.479544 #81200]  INFO -- :   Fusuma::Plugin::Events::Records::IndexRecord
I, [2021-03-21T05:46:22.479552 #81200]  INFO -- :   Fusuma::Plugin::Events::Records::KeypressRecord
I, [2021-03-21T05:46:22.479560 #81200]  INFO -- :   Fusuma::Plugin::Events::Records::TextRecord
I, [2021-03-21T05:46:22.479568 #81200]  INFO -- :   Fusuma::Plugin::Executors::CommandExecutor
I, [2021-03-21T05:46:22.479576 #81200]  INFO -- :   Fusuma::Plugin::Executors::SendkeyExecutor
I, [2021-03-21T05:46:22.479585 #81200]  INFO -- :   Fusuma::Plugin::Executors::WmctrlExecutor
I, [2021-03-21T05:46:22.479594 #81200]  INFO -- :   Fusuma::Plugin::Filters::KeypressFilter
I, [2021-03-21T05:46:22.479603 #81200]  INFO -- :   Fusuma::Plugin::Filters::LibinputDeviceFilter
I, [2021-03-21T05:46:22.479611 #81200]  INFO -- :   Fusuma::Plugin::Filters::LibinputTimeoutFilter
I, [2021-03-21T05:46:22.479620 #81200]  INFO -- :   Fusuma::Plugin::Inputs::LibinputCommandInput
I, [2021-03-21T05:46:22.479629 #81200]  INFO -- :   Fusuma::Plugin::Parsers::KeypressParser
I, [2021-03-21T05:46:22.479638 #81200]  INFO -- :   Fusuma::Plugin::Parsers::LibinputGestureParser
I, [2021-03-21T05:46:22.479647 #81200]  INFO -- :   Fusuma::Plugin::Parsers::TapParser
I, [2021-03-21T05:46:22.479657 #81200]  INFO -- : ---------------------------------------------

Nothing happens when i tap with 1 finger or hold with 4 finger. I cant debug it since i dont see any log messages.

@HritwikSinghal
Copy link
Author

if you can tell me where to look for log message for tap client, maybe i can debug it @iberianpig

@iberianpig
Copy link
Owner

I looked at the yaml and the following seems to be wrong

  • The indentation of 1: below the tap is missing.
  • Please use command: instead of sendkey: for debugging with echo.
tap: 
-1:
+  1:
-  sendkey: "echo ----------------tap1----------------------------"
+  command: "echo ----------------tap1----------------------------"

BTW, sendkey: PLAYPAUSE didn't work for spotify play/stop in my environment.

@HritwikSinghal
Copy link
Author

HritwikSinghal commented Mar 21, 2021

I looked at the yaml and the following seems to be wrong

* The indentation of 1: below the tap is missing.

oh, my bad, but even after indentation, it does not work. and command does not output anything

BTW, sendkey: PLAYPAUSE didn't work for spotify play/stop in my environment.

i am using rhythmbox and lollypop and this used to work in my prev installs. so can you tell me how to debug it?

@iberianpig
Copy link
Owner

iberianpig commented Mar 21, 2021

i am using rhythmbox and lollypop and this used to work in my prev installs. so can you tell me how to debug it?

  1. For checking fusuma-plugin-sendkey working correctly, you can emulate send key from the terminal like following
$ fusuma-sendkey PLAYPAUSE
  1. fusuma-plugin-tap parses verbose log of libinput
    You can check tap events from outputs of $ libinput debug-events --enable-tap --verbose
$ libinput debug-events --enable-tap --verbose | grep --line-buffered tap:

event8  - tap: touch 0 (TOUCH_BEGIN), tap state TAP_STATE_IDLE → TAP_EVENT_TOUCH → TAP_STATE_TOUCH
event8  - tap: touch 1 (TOUCH_BEGIN), tap state TAP_STATE_TOUCH → TAP_EVENT_TOUCH → TAP_STATE_TOUCH_2
event8  - tap: touch 2 (TOUCH_BEGIN), tap state TAP_STATE_TOUCH_2 → TAP_EVENT_TOUCH → TAP_STATE_TOUCH_3
event8  - tap: touch 1 (TOUCH_END), tap state TAP_STATE_TOUCH_3 → TAP_EVENT_RELEASE → TAP_STATE_TOUCH_2_HOLD
event8  - tap: touch 0 (TOUCH_END), tap state TAP_STATE_TOUCH_2_HOLD → TAP_EVENT_RELEASE → TAP_STATE_HOLD
event8  - tap: touch 2 (TOUCH_END), tap state TAP_STATE_HOLD → TAP_EVENT_RELEASE → TAP_STATE_IDLE

And I noticed that libinput v1.17.0 debug-events format is changed, and it doesn't work tap and hold detection.

  • v1.10.4 N/A (stops working after palm detection)
  • v1.14.1 works
  • v1.15.5 works
  • v1.16.5 works
  • v1.17.0 N/A (--verbose log format has been changed 😭 )

@HritwikSinghal
Copy link
Author

And I noticed that libinput v1.17.0 debug-events format is changed, and it doesn't work tap and hold detection.

* v1.10.4 N/A (stops working after palm detection)

* v1.14.1 works

* v1.15.5 works

* v1.16.5 works

* v1.17.0 N/A (--verbose log format has been changed sob )

Wait so what does this mean? no more tap events ?

@iberianpig
Copy link
Owner

Image from Gyazo

No, the tap events are still being written out.

On the left is the log of libinput debug-events --verbose --enable-tap for v1.17.0 and on the right for v1.16.5.

Some logs colored on the left have changed format, it needs to be rewritten in the parser for v1.17.0.

This is a problem with fusuma-plugin-tap, which depends on the verbose log. For a permanent solution, I think we should get events from libinput API or evdev instead of verbose log.

@HritwikSinghal
Copy link
Author

This is a problem with fusuma-plugin-tap, which depends on the verbose log. For a permanent solution, I think we should get events from libinput API or evdev instead of verbose log.

i think if you use libinput API, it will also fix the issue where fusuma executes 4 finger tap after doing 3 finger swipe and holding.

@HritwikSinghal
Copy link
Author

Hold gestures are coming to libinput by default so you may want to wait for them. See https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/602

@TonCherAmi
Copy link

It seems to have been merged.

http://who-t.blogspot.com/2021/07/libinput-and-hold-gestures.html

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants