8000 [Feature] Detect long press on input button · Issue #1086 · sezanzeb/input-remapper · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[Feature] Detect long press on input button #1086

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

Open
antlassagne opened this issue Apr 8, 2025 · 1 comment
Open

[Feature] Detect long press on input button #1086

antlassagne opened this issue Apr 8, 2025 · 1 comment

Comments

@antlassagne
Copy link

That could add several function to the same button.

As an example, I have a mouse with 2 additional buttons (back and forward) that are map to "switch previous / next workspace". I'd love to map long press on these to "move current window to previous / next workspace".

@TherinS
Copy link
TherinS commented May 28, 2025

Input-Remapper already has a function to have a button perform two different actions depending on the length of time it is pressed. That code can be found here https://github.com/sezanzeb/input-remapper/blob/main/readme/macros.md under "if-tap".

If I understand your request and the way the "if-tap" macro functions:

  1. Program the mouse key to the normal function of that key in the first section of the macro.
  2. Program the key combination that moves a window to another desktop into the second section of the macro. On Linux Mint, for example, that key combo is "shift+control+alt + right arrow".
  3. To automatically return to the desktop you just left, you could put a delay after that and then the key combination "control+alt + left arrow".

This should have the effect of, when long-pressing the button longer than the delay time, taking the active window to the next workspace and then returning you to the previous workspace.

If you are wanting to only SEND the window to another workspace without leaving the one you are on, then these couple of pages might help. One of them looks like it would work best to set up a key combination to move the window to a keyboard key, then bind the mouse button to that keyboard key.

https://askubuntu.com/questions/1216679/how-can-i-send-a-window-to-a-different-workspace-without-changing-the-active-wor

https://askubuntu.com/questions/59783/how-to-move-windows-to-another-workspace-without-switching-workspace?noredirect=1&lq=1

I hope those help! Let us know.

EDIT: Also, this code binds my 'O' key to output an O if held down for less than 250ms, otherwise it outputs a "6". Maybe you can use this as a starting point if you get the key combination figured out.
code = if_single(key(KEY_O), key(KEY_6), 250)

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
0