Swapping mouse scroll wheel actions causes lag to scrolling
Opened this issue · 6 comments
Hi! First of all I want to thank you for such a polished software.
It has been very intutitive to configure and use to map my keyboard on Windows to be closely matching Mac keyboard layout.
I was thinking about swapping the mouse scroll wheel up and down actions with keymapper also, but this seems to be adding significant lag/delay to scroll actions when inverting/swapping the actions with keymapper.
It seems as if the original action doesn't get canceled because with my WheelUp >> WheelDown remap, I sometimes see it slightly scroll up.
Thank you very much for your kind words!
I also noticed this. But I do not know the reason yet.
This should work now much better with the 4.9.1 release.
Unfortunately I noticed, that some applications (like Firefox, Edge, VSCode, Explorer) resist any mouse wheel mapping (buttons work!). I am afraid, there is nothing I can do about that. Fortunately there are ways to achieve that by other means.
Thank you for so quickly working on the issue!
It is surprising to hear that mouse wheel mapping didn't work for you in those applications as it is working for me. Could it be depending on the configuration? My configuration as a reference:
Alt >> Control
ButtonForward >> Meta{Tab}
Control >> Meta
Meta >> AltLeft
PrintScreen >> AltRight
WheelDown >> WheelUp
WheelUp >> WheelDown
[stage]
[modifier = "Control Shift"]
ArrowLeft >> !Any Shift{Home}
ArrowRight >> !Any Shift{End}
[modifier = "Alt Shift"]
ArrowLeft >> !Any Control{Shift{ArrowLeft}}
ArrowRight >> !Any Control{Shift{ArrowRight}}
[default]
@forward-modifiers Control
Alt{ArrowLeft} >> Control{ArrowLeft}
Alt{ArrowRight} >> Control{ArrowRight}
Alt{IntlBackslash} >> '|'
Control{ArrowLeft} >> Home
Control{ArrowRight} >> End
It definitely is better now, but unfortunately the scrolling sometimes still experiences a delay/lag. However I completely understand if this issue is not a high priority for you and I can go a head with another approach.
Edit: video of how it looks like: https://youtube.com/shorts/l2MOqi9Z9q0
Edit 2: another video demonstrating that not only the scrolling is delayed, but mouse input in general gets laggy: https://youtube.com/shorts/DlCFBNRkjV8
I have investigated it myself also and it seems like the SendInput method is "getting throttled" by Windows if gets executed too much. What's interesting is that there is significant difference when I move mouse around while scrolling (a lot more responsive) vs. keeping mouse still while scrolling (lagging almost immediately if scrolling rapidly).
The Interception driver seems to have basically native performance in this regard, but keymapper is not including mouse events when in "Interception driver mode"?
Also found an interesting post on Microsoft Learn Q&A, where one person had similar lag issue using SendInput (though for middle mouse button down/up events) and was seemingly able to solve it: https://learn.microsoft.com/en-us/answers/questions/255509/send-mouse-wheel-click-properly-(sendinput-mouseev
Thanks for your investigations! I will think about it and try to further improve the performance.
But for now you might want to try the last commit, which adds the Interception driver support also for the mouse.
@houmain Thank you very much, I will try it out!
In the meantime I have also found out some new interesting things: for keyboard inputs the dwExtraInfo
always has correct information and injected
variable gets its value correctly on every single remap.
However, on mouse inputs it seems like the information on dwExtraInfo
is very randomly (for example scrolling without moving mouse sometimes has it, sometimes don't) getting lost sometimes (while the remap itself is retained correctly), and the hiccup occurs only when the information has been "lost".