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

Middlemouse - ignore single clicks, but register holding down the button #861

Open
anijatsu opened this issue Oct 18, 2024 · 1 comment
Open

Comments

@anijatsu
Copy link

Hi,
I'm trying to work around an issue while working with miro.com boards using the Google Chrome browser (/w Wayland #ozone-platform-hint flag set) on Ubuntu 24.04.01 LTS with GNOME Wayland.

I use the scroll wheel to pan around the board, but often this also registers a singular scroll wheel click (middlemouse), causing a clipboard insert action instead of a continuous viewport pan.

I'd like to configure keyd to only allow holding down the middlemouse button, but ignoring single clicks while I'm using Chrome.

However I notice two things:

  • Overload doesn't seem to achieve this behavior, or I misunderstand how it's supposed to be used
  • Defining the application binary name ([chrome]) as the section name doesn't seem to have Chrome adhere to rules from keyd. If I use the same line in the [main] section the rule I specify does work, but then it of course applies to all applications.
[ids]
1532:0090
[chrome]
middlemouse = overload(escape, middlemouse)

I also want to note that using Gnome Tweaks to disable Middle Click Paste doesn't apply to Chrome's behavior. I assume the browser has its own implementation for handling kb/m inputs.

@nsbgn
Copy link

nsbgn commented Oct 18, 2024

keyd cannot by itself apply bindings only to specific applications; the keyd-application-mapper companion script (which is shipped with keyd) can. See the manual for that application for specifics.

overload is indeed not used in that way; its first argument is a layer that will be activated as soon as the press of that key overlaps with a subsequent key.

In fact, I don't think that your use case is currently facilitated. middlemouse = timeout(noop, 200, middlemouse) comes close, but it would mean that you'd get a delay before the activation of middlemouse, which is probably not what you want.

You want to immediately generate the keydown, but generate escape if the keyup happens too soon. I vaguely remember there have been some related feature requests; if I have time I will look for them.

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

No branches or pull requests

2 participants