Block default action #443
Replies: 1 comment 2 replies
-
If you map "Wheel Hi Res" to disable it should work for both wayland and x11
There is the However: this will not work for you because the wheel is not a button, but we can abuse the fact that
mapping 1 sets the variable |
Beta Was this translation helpful? Give feedback.
-
I need to remap extra mouse button (forward) + scroll to change audio volume. Done it like this:
But there's one issue: default actions are not being prevented and that way it's unusable for me.
If I press extra button + roll the wheel, volume changes but hovered page/app also scrolls. That scrolling shouldn't happen.
Similarly, forward button is also acting on combination when suitable, but should be prevented.
In other words:
Expected result:
Actual result:
Is there any way to block default action of remapped keys/buttons in a combination?
Thanks.
--- ** Edit ** ---
I just tested Beta, the recorded input adds "Wheel HI RES". That plus "Release Input" enabled (default) is causing scroll to be cancelled. That fixes part of the issue.
But forward action (like going forward one page in browser tab history) is still being executed when it shouldn't. I believe the reason is as follows:
Forward action is triggered on "button down" (hold), not on "button up" (release). So when I trigger the secondary input of the combination (wheel), forward action already ran because forward button was already "clicked".
So I need to disable forward action on "button down" (hold) and enable it on "button up" (release), because I'm using it as a modifier. That way I believe its default action could be cancelled when I click a secondary button in combination (in this case, turning mouse wheel). How to do that with input-remapper?
I'm able to do that with xbindkeys, that's is what I've been using for a long time. But xbindkeys is X11 and I would like to switch to Wayland, so I'm trying to achieve the same with input-remapper.
--- ** Edit 2 ** ---
I kinda got it:
This means: if I quickly release forward button after pressing, do forward action. Otherwise I'm holding the button so don't do nothing.
This does the job, I'm fine with it, but I'll leave this interesting question: is it possible for input-remapper to only do something on input RELEASE? Example: on pressing
a
key, only printa
after key release, no matter how long the key was pressed.The closest I found is
if_single
, but apparently it's restricted to keyboard keys. There should be something equivalent for mouse buttons/axis.--- ** Edit 3 ** ---
I just started a Wayland session and here I needed to remove "Wheel HI RES" from recorded input in order to be able to cancel scrolling.
Beta Was this translation helpful? Give feedback.
All reactions