JoseExposito / touchegg

Linux multi-touch gesture recognizer
GNU General Public License v3.0
3.68k stars 173 forks source link

Two-fingers gesture not working in Kubuntu 23.04 #621

Closed nicon89 closed 1 year ago

nicon89 commented 1 year ago

Describe the bug

Two-fingers gesture is not working on Kubuntu 23.04 in version 202302070101-stable-2.0.16~ubuntu22.04.1. It works fine in official Ubuntu version 1.1.1-0ubuntu4.

Expected behaviour

Scroll down in browser.

Actual behaviour

Selection happens (like with one finger).

Logs

$ touchegg --debug
Touchégg v2.0.16.
Starting Touchégg in client mode
Parsing your configuration file...
Using configuration file "/home/nicon/.config/touchegg/touchegg.conf"
Configuration parsed successfully
Connecting to Touchégg daemon...
Connection with Touchégg established
Gesture begin detected
        Gesture information:
                Fingers: 2
                Type: SWIPE
                Direction: DOWN
        Gesture performed on app: firefox
        No action configured for this gesture
        Ignoring this gesture. This could mean no action is configured, the configured action is not supported or that it was performed in a system window (panel, dock, desktop, etc)
Gesture begin detected
        Gesture information:
                Fingers: 2
                Type: SWIPE
                Direction: DOWN
        Gesture performed on app: firefox
        No action configured for this gesture
        Ignoring this gesture. This could mean no action is configured, the configured action is not supported or that it was performed in a system window (panel, dock, desktop, etc)

Your environment

JoseExposito commented 1 year ago

The log reads:

        Gesture performed on app: firefox
        No action configured for this gesture
        Ignoring this gesture. This could mean no action is configured [...]

Could you double check that you configured an action, please? Feel free to share your config file and I'll have a look.

nicon89 commented 1 year ago

I tried with and without this config. In version 1.1.1 swiping with two fingers scrolls the screen.

<touchégg>
  <settings>
    <property name="composed_gestures_time">0</property>
  </settings>
  <application name="All">
    <gesture type="TAP" fingers="2" direction="UNKNOWN">
      <action type="MOUSE_CLICK">undefined</action>
    </gesture>
    <gesture type="TAP" fingers="5" direction="UNKNOWN">
      <action type="CLOSE_WINDOW"></action>
    </gesture>
    <gesture type="DRAG" fingers="2" direction="ALL">
      <action type="SCROLL">undefined</action>
    </gesture>
    <gesture type="DRAG" fingers="3" direction="UP">
      <action type="MAXIMIZE_RESTORE_WINDOW"></action>
    </gesture>
    <gesture type="DRAG" fingers="3" direction="DOWN">
      <action type="MINIMIZE_WINDOW"></action>
    </gesture>
    <gesture type="DRAG" fingers="3" direction="LEFT">
      <action type="MOVE_WINDOW"></action>
    </gesture>
    <gesture type="DRAG" fingers="3" direction="RIGHT">
      <action type="MOVE_WINDOW"></action>
    </gesture>
    <gesture type="DRAG" fingers="4" direction="UP">
      <action type="SEND_KEYS">undefined</action>
    </gesture>
    <gesture type="DRAG" fingers="4" direction="DOWN">
      <action type="SHOW_DESKTOP"></action>
    </gesture>
    <gesture type="PINCH" fingers="3" direction="ALL">
      <action type="RESIZE_WINDOW"></action>
    </gesture>
    <gesture type="PINCH" fingers="5" direction="ALL">
      <action type="SEND_KEYS">undefined</action>
    </gesture>
    <gesture type="SWIPE" fingers="4" direction="UP">
      <action type="CHANGE_DESKTOP"></action>
    </gesture>
    <gesture type="TAP" fingers="3" direction="UNKNOWN">
      <action type="MOUSE_CLICK">
        <button>1</button>
        <on>begin</on>
      </action>
    </gesture>
  </application>
  <application name=" dolphin">
  </application>
  <application name=" gwenview">
  </application>
  <application name="chromium-browser">
    <gesture type="DRAG" fingers="2" direction="LEFT">
      <action type="SEND_KEYS">undefined</action>
    </gesture>
    <gesture type="DRAG" fingers="2" direction="RIGHT">
      <action type="SEND_KEYS">undefined</action>
    </gesture>
  </application>
  <application name="dolphin">
    <gesture type="DRAG" fingers="2" direction="LEFT">
      <action type="SEND_KEYS">undefined</action>
    </gesture>
    <gesture type="DRAG" fingers="2" direction="RIGHT">
      <action type="SEND_KEYS">undefined</action>
    </gesture>
  </application>
  <application name="gwenview">
    <gesture type="PINCH" fingers="2" direction="IN">
      <action type="SEND_KEYS">undefined</action>
    </gesture>
    <gesture type="PINCH" fingers="2" direction="OUT">
      <action type="SEND_KEYS">undefined</action>
    </gesture>
    <gesture type="ROTATE" fingers="2" direction="LEFT">
      <action type="SEND_KEYS">undefined</action>
    </gesture>
    <gesture type="ROTATE" fingers="2" direction="RIGHT">
      <action type="SEND_KEYS">undefined</action>
    </gesture>
  </application>
  <application name="okular">
    <gesture type="PINCH" fingers="2" direction="IN">
      <action type="SEND_KEYS">undefined</action>
    </gesture>
    <gesture type="PINCH" fingers="2" direction="OUT">
      <action type="SEND_KEYS">undefined</action>
    </gesture>
    <gesture type="ROTATE" fingers="2" direction="LEFT">
      <action type="SEND_KEYS">undefined</action>
    </gesture>
    <gesture type="ROTATE" fingers="2" direction="RIGHT">
      <action type="SEND_KEYS">undefined</action>
    </gesture>
  </application>
JoseExposito commented 1 year ago

The configuration used by v1 is not 100% compatible with v2. I'd recommend to update to v2, backup and delete the old configuration and use Touché to generate your new configuration.

Are you using a touchscreen or a touchpad? v2 does not support gestures with 2 fingers in touchpads.

nicon89 commented 1 year ago

I'm using touchscreen. Does v2 support scrolling gestures? I don't see them in Touche.

JoseExposito commented 1 year ago

There isn't a scroll action as in V1, but you can use: https://github.com/JoseExposito/touchegg#mouse-click-mouse_click

With values 4 and 5.

nicon89 commented 1 year ago

Got it. Thank you.

nicon89 commented 1 year ago

I got it running, but I used xdtool (scrolls more than value 4/5 for the "MOUSE_CLICK"), but now I wanted to make this case working: select text (swipe any direction) => right-click (two fingers tap) Right now it works partially - when I select text and right-click it un-selects the selected text. Is there something I can do with this?

My config file:

<touchégg>
  <settings>
    <property name="animation_delay">150</property>
    <property name="action_execute_threshold">20</property>
    <property name="color">auto</property>
    <property name="borderColor">auto</property>
  </settings>
  <application name="All">
    <gesture type="SWIPE" fingers="3" direction="UP">
      <action type="MAXIMIZE_RESTORE_WINDOW">
        <animate>true</animate>
      </action>
    </gesture>
    <gesture type="SWIPE" fingers="3" direction="DOWN">
      <action type="MINIMIZE_WINDOW">
        <animate>true</animate>
      </action>
    </gesture>
    <gesture type="SWIPE" fingers="3" direction="LEFT">
      <action type="TILE_WINDOW">
        <direction>left</direction>
        <animate>true</animate>
      </action>
    </gesture>
    <gesture type="SWIPE" fingers="3" direction="RIGHT">
      <action type="TILE_WINDOW">
        <direction>right</direction>
        <animate>true</animate>
      </action>
    </gesture>
    <gesture type="PINCH" fingers="3" direction="IN">
      <action type="CLOSE_WINDOW">
        <animate>true</animate>
        <color>F84A53</color>
        <borderColor>F84A53</borderColor>
      </action>
    </gesture>
    <gesture type="SWIPE" fingers="4" direction="UP">
      <action type="CHANGE_DESKTOP">
        <direction>auto</direction>
        <animate>true</animate>
        <animationPosition>auto</animationPosition>
      </action>
    </gesture>
    <gesture type="SWIPE" fingers="4" direction="DOWN">
      <action type="CHANGE_DESKTOP">
        <direction>auto</direction>
        <animate>true</animate>
        <animationPosition>auto</animationPosition>
      </action>
    </gesture>
    <gesture type="SWIPE" fingers="4" direction="RIGHT">
      <action type="SEND_KEYS">
        <repeat>false</repeat>
        <modifiers>Super_L</modifiers>
        <keys>S</keys>
        <on>begin</on>
      </action>
    </gesture>
    <gesture type="PINCH" fingers="4" direction="OUT">
      <action type="SHOW_DESKTOP">
        <animate>true</animate>
      </action>
    </gesture>
    <gesture type="PINCH" fingers="4" direction="IN">
      <action type="SEND_KEYS">
        <repeat>false</repeat>
        <modifiers>Super_L</modifiers>
        <keys>A</keys>
        <on>begin</on>
      </action>
    </gesture>
    <gesture type="TAP" fingers="3" direction="UNKNOWN">
      <action type="MOUSE_CLICK">
        <button>2</button>
        <on>begin</on>
      </action>
    </gesture>
    <gesture type="SWIPE" fingers="2" direction="DOWN">
      <action type="RUN_COMMAND">
        <repeat>true</repeat>
        <command>xdotool click 4</command>
        <decreaseCommand>xdotool click 5</decreaseCommand>
      </action>
    </gesture>
    <gesture type="SWIPE" fingers="2" direction="UP">
      <action type="RUN_COMMAND">
        <repeat>true</repeat>
        <command>xdotool click 5</command>
        <decreaseCommand>xdotool click 4</decreaseCommand>
      </action>
    </gesture>
    <gesture type="TAP" fingers="2" direction="UNKNOWN">
      <action type="MOUSE_CLICK">
        <button>3</button>
        <on>begin</on>
      </action>
    </gesture>
  </application>
  <application name="chromium-browser">
    <gesture type="PINCH" fingers="2" direction="IN">
      <action type="SEND_KEYS">
        <repeat>true</repeat>
        <modifiers>Control_L</modifiers>
        <keys>KP_Subtract</keys>
        <decreaseKeys>KP_Add</decreaseKeys>
      </action>
    </gesture>
    <gesture type="PINCH" fingers="2" direction="OUT">
      <action type="SEND_KEYS">
        <repeat>true</repeat>
        <modifiers>Control_L</modifiers>
        <keys>KP_Add</keys>
        <decreaseKeys>KP_Subtract</decreaseKeys>
      </action>
    </gesture>
  </application>
  <application name="google-chrome">
    <gesture type="PINCH" fingers="2" direction="IN">
      <action type="SEND_KEYS">
        <repeat>true</repeat>
        <modifiers>Control_L</modifiers>
        <keys>KP_Subtract</keys>
        <decreaseKeys>KP_Add</decreaseKeys>
      </action>
    </gesture>
    <gesture type="PINCH" fingers="2" direction="OUT">
      <action type="SEND_KEYS">
        <repeat>true</repeat>
        <modifiers>Control_L</modifiers>
        <keys>KP_Add</keys>
        <decreaseKeys>KP_Subtract</decreaseKeys>
      </action>
    </gesture>
  </application>
</touchégg>

Thank you!

nicon89 commented 1 year ago

Also I was looking for a way to move application to another (KDE) desktop with 4-finger swipe on left/right, so that would play nicely with:

    <gesture type="SWIPE" fingers="4" direction="UP">
      <action type="CHANGE_DESKTOP">
        <direction>auto</direction>
        <animate>true</animate>
        <animationPosition>auto</animationPosition>
      </action>
    </gesture>

Do you have any suggestions how this can be done? Thank you!

JoseExposito commented 1 year ago

Right now it works partially - when I select text and right-click it un-selects the selected text. Is there something I can do with this?

Not much other than emulating right click with the MOUSE_CLICK action.

I think that GTK and apps like Chrome support long-click to open the contextual menu... And the toolkit (i.e., GTK, Qt, etc) is the right place to implement it. You'd get a better user experience requesting this feature in the toolkit rather than trying to workaround it with a tool like this one.

Also I was looking for a way to move application to another (KDE) desktop with 4-finger swipe on left/right

Have you tried to use the SEND_KEYS action to use the shortcut associated with that action?

nicon89 commented 1 year ago

I do emulate right click with the mouse click - I'm able to do right click with two-finger tap, but for some reason it unselects the text that select first.

nicon89 commented 1 year ago

Have you tried to use the SEND_KEYS action to use the shortcut associated with that action? Yes, I got this one working, thanks!

JoseExposito commented 1 year ago

I do emulate right click with the mouse click - I'm able to do right click with two-finger tap, but for some reason it unselects the text that select first

Yes, as I mentioned I can not change that, you can try to request it to the developers of the toolkit or app you are using.

nicon89 commented 1 year ago

Got it. Thank you anyway.