houmain / keymapper

A cross-platform context-aware key remapper.
GNU General Public License v3.0
260 stars 22 forks source link

Keymapper prevents some mouses from not scrolling #21

Closed kir12 closed 2 years ago

kir12 commented 2 years ago

Hello,

After some troubleshooting, I found out that turning on keymapper's services disables certain mouses from being able to move the mouse cursor. (Specifically, the Logitech G305 in my case) The thread where we found this out is here, but essentially seth found that GrabbedKeyboards.cpp, line 37 const auto required_bits = (1 << EV_SYN) | (1 << EV_KEY) | (1 << EV_REP); may require some more events to ensure other mouse related events don't get accidentally mishandled by the program. They recommend that the below events also get checked for: REL_X, REL_Y, REL_HWHEEL, REL_WHEEL, REL_WHEEL_HI_RES, REL_HWHEEL_HI_RES . So in other words, I'd imagine the new variable would look something like:

const auto required_bits = (1 << EV_SYN) | (1 << EV_KEY) | (1 << EV_REP) | (1 << REL_X) | (1 << REL_Y) | (1 << REL_WHEEL) | (1 << REL_WHEEL) | (1 << REL_WHEEL_HI_RES) | (1 << REL_HWHEEL_HI_RES)

Thoughts?

houmain commented 2 years ago

Thank you for reporting this issue! I doubt that this change would fix it. Give me some time to investigate.

houmain commented 2 years ago

I got my hands on a G300s. But unlike your G305 it does not add a combined device but two separate devices. So I could not directly reproduce the behavior you described (only the keyboard part was grabbed and the mouse kept working). For now (with the latest commit 2f8408f4f3ee40223663a95dd1f2932ce42dc53e) combined devices are no longer grabbed. I am thinking about adding the possibility to configure which devices should be grabbed.