Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Extend touchscreen functionality to support out-of-the-box touchpad gestures such as two-finger/long hold right click #378

Closed
m-roberts opened this issue Oct 30, 2020 · 5 comments

Comments

@m-roberts
Copy link
Contributor

The current version of Touchégg (v2.0.2 as of writing) adds touchscreen support, which is fantastic!

However, I think that it would be even better if it were able to extend touchscreen gestures to match the typical behaviour of a touchpad - e.g.:

  • 2-finger right-click
  • 3-finger middle-click

This was available in v1.1.1 as this was not based on libinput. The alternative for users who are seeking this functionality would be to install another tool for handling these “not really gestures but still require a daemon to intercept and modify behaviour” functionalities (see https://github.com/Plippo/twofing). However, having 2 input device-parsing daemons just seems like a missed opportunity. It would be great if, with one application, you could do anything with a touchscreen that you could do with a touchpad all from one tool.

There are some obvious questions:

  • Should the config file be able to define “touchscreen only”/“touchpad only” gestures? Perhaps touchscreen-specific gestures should have their own separate config file?
  • Obviously, handling touch events like this can interfere with applications that handle touch already, such as Chrome. To ensure an optimised experience, would this require something like the ability to blacklist certain windows from accepting these gestures? i.e. “ignore right click on 2-finger tap if in Chrome”
@JoseExposito
Copy link
Owner

I think this is a great feature to have. In the meanwhile, you can use RUN_COMMAND and xdtool click:
https://github.com/JoseExposito/touchegg#execute-a-command-run_command

$ xdotool click --help
Usage: click [options] <button>
--clearmodifiers       - reset active modifiers (alt, etc) while typing
--window WINDOW        - specify a window to send click to
--repeat REPEATS       - number of times to click. Default is 1
--delay MILLISECONDS   - delay in milliseconds between clicks.
    This has no effect if you do not use --repeat.
    Default is 100ms

Button is a button number. Generally, left = 1, middle = 2, 
right = 3, wheel up = 4, wheel down = 5

@JoseExposito JoseExposito self-assigned this Dec 4, 2020
@JoseExposito JoseExposito added this to the 2.0.4 milestone Dec 4, 2020
@JoseExposito
Copy link
Owner

I just added a new gesture type and a new action:

TAP: Only for touch screens. Min: 2 fingers. Max: Whatever your touch screen supports
MOUSE_CLICK: Buttons 1, 2, or 3 (left, middle, right)

For example:

    <gesture type="TAP" fingers="2">
      <action type="MOUSE_CLICK">
        <button>3</button>
        <on>begin</on>
      </action>
    </gesture>

I experimented with a long click gesture, but the user experience is sooooo bad. You can not rest the hand in the touch screen without triggering it plus many apps start dragging stuff around, so I decided to remove that code.

Let me know if this works for you please.

@m-roberts
Copy link
Contributor Author

Hey - sorry, been very busy with other things. Will be looking to move to this release soon, so will let you know how it goes! Thanks for this!

@m-roberts
Copy link
Contributor Author

Is there any chance that we can get this added to the default config? Seems worthwhile:

  <application name="All">
    <gesture type="TAP" fingers="2">
      <action type="MOUSE_CLICK">
        <button>3</button>
        <on>begin</on>
      </action>
    </gesture>

    <gesture type="TAP" fingers="3">
      <action type="MOUSE_CLICK">
        <button>2</button>
        <on>begin</on>
      </action>
    </gesture>

Otherwise we will need to provide our own version of the package just to enable this, but it seems like something that would be wanted by people installing this for touchscreens, and it doesn't affect touchpads.

@JoseExposito
Copy link
Owner

Done a36303d

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

No branches or pull requests

2 participants