iberianpig / fusuma-plugin-keypress

Keypress combination plugin for Fusuma
https://github.com/iberianpig/fusuma#available-plugins
MIT License
26 stars 4 forks source link

It doesn't work on Debian Gnome #4

Closed ghost closed 3 years ago

ghost commented 3 years ago

Hi,

When I try to use LEFTCTRL or LEFTSHIFT with a swipe, it doesn't work at all, here is my config:

swipe: 3: left: command: 'xdotool key Alt+Tab' right: command: 'xdotool key Alt+Tab' up: command: 'xdotool key Super' keypress: LEFTSHIFT: command: 'xdotool key Super+a' down: command: 'xdotool key Alt+Super+Down'

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

drnguyenn commented 3 years ago

Which distribution of Ubuntu do you use ?

ghost commented 3 years ago

I’m using Kali Linux under Gnome 3.38

iberianpig commented 3 years ago

Hi, please try the following configuration.

      keypress:
        LEFTSHIFT:
          command: 'xdotool key --clearmodifiers Super+a'

Or use fusuma-plugin-sendkey instead of xdotool.

ghost commented 3 years ago

I tired 'xdotool key --clearmodifiers Super+a' but it doesn't work it type "a" when I hold shift and swipe up with 3 fingers

With fusuma-plugin-sendkey, it silply doesn't work at all

iberianpig commented 3 years ago

On terminal, does it work $ xdotool key Super+a

ghost commented 3 years ago

Yep, I tried it before installing fusuma-sendkey

iberianpig commented 3 years ago

Could you paste the output of $ fusuma --version ?

ghost commented 3 years ago

W, [2021-08-13T18:22:42.714104 #84092] WARN -- : config file: /root/.config/fusuma/config.yml is NOT FOUND I, [2021-08-13T18:22:42.714155 #84092] INFO -- : reload config: /usr/app/lib/ruby/gems/3.0.0/gems/fusuma-2.0.5/lib/fusuma/config.yml I, [2021-08-13T18:22:43.028692 #84092] INFO -- : --------------------------------------------- I, [2021-08-13T18:22:43.028954 #84092] INFO -- : Fusuma: 2.0.5 I, [2021-08-13T18:22:43.031004 #84092] INFO -- : libinput: 1.16.4 I, [2021-08-13T18:22:43.031041 #84092] INFO -- : ruby 3.0.0p0 I, [2021-08-13T18:22:43.032552 #84092] INFO -- : OS: Linux 5.10.0-kali9-amd64 #1 SMP Debian 5.10.46-1kali1 (2021-06-25) I, [2021-08-13T18:22:43.033609 #84092] INFO -- : Distribution: Kali GNU/Linux Rolling \n \l I, [2021-08-13T18:22:43.034521 #84092] INFO -- : Desktop session: gnome x11 I, [2021-08-13T18:22:43.034551 #84092] INFO -- : --------------------------------------------- I, [2021-08-13T18:22:43.034566 #84092] INFO -- : Enabled Plugins: I, [2021-08-13T18:22:43.034861 #84092] INFO -- : Fusuma::Plugin::Buffers::GestureBuffer I, [2021-08-13T18:22:43.034873 #84092] INFO -- : Fusuma::Plugin::Buffers::KeypressBuffer I, [2021-08-13T18:22:43.034881 #84092] INFO -- : Fusuma::Plugin::Buffers::TapBuffer I, [2021-08-13T18:22:43.034888 #84092] INFO -- : Fusuma::Plugin::Buffers::TimerBuffer I, [2021-08-13T18:22:43.034894 #84092] INFO -- : Fusuma::Plugin::Detectors::KeypressDetector I, [2021-08-13T18:22:43.034901 #84092] INFO -- : Fusuma::Plugin::Detectors::PinchDetector I, [2021-08-13T18:22:43.034911 #84092] INFO -- : Fusuma::Plugin::Detectors::RotateDetector I, [2021-08-13T18:22:43.034918 #84092] INFO -- : Fusuma::Plugin::Detectors::SwipeDetector I, [2021-08-13T18:22:43.034926 #84092] INFO -- : Fusuma::Plugin::Detectors::TapDetector I, [2021-08-13T18:22:43.034932 #84092] INFO -- : Fusuma::Plugin::Events::Records::ContextRecord I, [2021-08-13T18:22:43.034939 #84092] INFO -- : Fusuma::Plugin::Events::Records::GestureRecord I, [2021-08-13T18:22:43.034946 #84092] INFO -- : Fusuma::Plugin::Events::Records::IndexRecord I, [2021-08-13T18:22:43.034952 #84092] INFO -- : Fusuma::Plugin::Events::Records::KeypressRecord I, [2021-08-13T18:22:43.034959 #84092] INFO -- : Fusuma::Plugin::Events::Records::TextRecord I, [2021-08-13T18:22:43.034965 #84092] INFO -- : Fusuma::Plugin::Executors::CommandExecutor I, [2021-08-13T18:22:43.034972 #84092] INFO -- : Fusuma::Plugin::Filters::KeypressFilter I, [2021-08-13T18:22:43.034978 #84092] INFO -- : Fusuma::Plugin::Filters::LibinputDeviceFilter I, [2021-08-13T18:22:43.034985 #84092] INFO -- : Fusuma::Plugin::Filters::LibinputTimeoutFilter I, [2021-08-13T18:22:43.034991 #84092] INFO -- : Fusuma::Plugin::Inputs::LibinputCommandInput I, [2021-08-13T18:22:43.034998 #84092] INFO -- : Fusuma::Plugin::Inputs::TimerInput I, [2021-08-13T18:22:43.035004 #84092] INFO -- : Fusuma::Plugin::Parsers::KeypressParser I, [2021-08-13T18:22:43.035011 #84092] INFO -- : Fusuma::Plugin::Parsers::LibinputGestureParser I, [2021-08-13T18:22:43.035018 #84092] INFO -- : Fusuma::Plugin::Parsers::TapParser I, [2021-08-13T18:22:43.035024 #84092] INFO -- : ---------------------------------------------

I use a custom config file: /etc/touchpad.yml, I created a shortcut in the startup directory that do for each boot: fusuma -d -c /etc/touchpad.yml

The /usr/app/ path is a custom directory with a ruby virtualenv

iberianpig commented 3 years ago

Thanks. Ummm, The fusuma version and installed plugins, in particular, seem to be fine.

Could you try again to install fusuma-plugin-sendkey and the following configuration?

      keypress:
        LEFTSHIFT:
          # command: 'xdotool key --clearmodifiers Super+a'
          sendkey: 'LEFTMETA+A'

BTW, You should use triple backticks("```") for formatting code block! It makes it easier to read code block on GitHub.

See: https://docs.github.com/en/github/writing-on-github/working-with-advanced-formatting/creating-and-highlighting-code-blocks

ghost commented 3 years ago

Yes it worked :-D

But since I have dual layout (en_US + fr_FR), I had to invert "a" to "q" when I'm in french layout.

keypress:
  LEFTSHIFT:
    sendkey: 'LEFTMETA+q'

Then when I switch to en_US, I have to modify sendkey: 'LEFTMETA+a' otherwise it will type "q"

I don't know why sendkey doesn't respect the layout order, that's why I prefer xdotool.

Fusuma in general is slow with dual layout keyboards, it works much better when I use my first keyboard layout which is french, once I switch to english, every gesture become sooo slow, like I have to wait 2 seconds, instead of 0.1 seconds.

iberianpig commented 3 years ago

It's not fusuma that's slow; it's xdotool that needs to switch keyboard layouts on the X layer.

fusuma-plugin-sendkey emulates keys in layers lower than X. Therefore, it avoids 1~2 seconds delays because it does not need the cost of keyboard layout translation. And it also works in Wayland.

ghost commented 3 years ago

Oh okay, That explains a lot. Thus Kali is still based on Xorg.

Hopefully I found another way, I used the Tap-and-Hold feature to trigger the app grid by holding four fingers.

ghost commented 3 years ago

Arigato, I resolved all issues, thanks to fusuma-sendkey

I converted all command: parameters to sendkey: and it works just great in both layouts

Thanks to you, I'll never use xdotool with fusuma again ;-)