iberianpig / fusuma

Multitouch gestures with libinput driver on Linux
MIT License
3.67k stars 149 forks source link

Keypress to move cursor events. #251

Closed arumihsnek closed 2 years ago

arumihsnek commented 3 years ago

Hi!

I don't know if this is a issue or a feature request.

I'm trying to use three fingers to "drag a window" (super+left drag) and pressing LEFTMETA change the "size of the window" (super + right drag). I tried multiples combination of the code, looking others examples of code using presskey and a can't do that. Each code works by itself.

swipe:
  3:
    begin:
      command: xdotool keydown super mousedown 1
      keypress:
       LEFTMETA:
        begin:
         command: xdotool keydown super mousedown 2
    update:
      command: xdotool mousemove_relative -- $move_x, $move_y
      interval: 0.01
      accel: 8
    end:
      command: xdotool keyup super mouseup 1
      keypress:
       LEFTMETA:
        command: xdotool keyup super mouseup 2

I tried too to combine drag windows and different commands to swipe 3 left, swipe right, etc and don't works too.

I don't know if that is possible, or if I'm doing something wrong, maybe if someone had done successfully can share the code?

Thanks!

iberianpig commented 3 years ago

Hi, @arumihsnek

what are you using OS/Window Manager?

I tried to only shortcut combination without fusuma in my environment GNOME Shell 3.36.9, on Ubuntu 20.04(X11)

"drag a window" (super+left drag)

it works.

But,

"size of the window" (super + right drag).

It doesn't work.

arumihsnek commented 3 years ago

Hi, @arumihsnek

what are you using OS/Window Manager?

KDE in arch, effectively doesn't works all together with the modifiers, but i can do one of this things choosing the correct mouse button (without keypress modifiers) in the code.

iberianpig commented 3 years ago

How behavior do you expect it to work?

swipe:
  3:
    begin:
      command: xdotool keydown super mousedown 1
      keypress:
       LEFTMETA:
        begin:
         command: xdotool keydown super mousedown 2 # <---- here

I was wondering what you want to do with the above part.


BTW, I think that you need to avoid conflicts between key presses by xdotool and user keyboard presses.

swipe:
  3:
    begin:
      command: xdotool keydown super mousedown 1
      keypress:
       LEFTMETA:
        begin:
-         command: xdotool keydown super mousedown 2
+         command: xdotool mousedown 2

If you want to avoid LEFTMETA key conflicts, please exclude keydown / keyup like this. And I think this is a xdotool issue, not with fusuma.

arumihsnek commented 3 years ago

Thanks @iberianpig , i will try in this way.

Do you know how to use fusuma-sendkey at the place of xdotool for mouse buttons and "xdotool mousemove_relative -- $move_x, $move_y" ??

iberianpig commented 3 years ago

Mouse devices are not supported as fusuma-plugin-sendkey is only responsible for keyboard output.

iberianpig commented 3 years ago

Of course, we can do this by creating a uinput virtual device and controlling it as a fusuma plugin.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.