Closed niwla23 closed 1 year ago
Thanks for reporting! I suspect that the keyboard is the problem. Have you tried another keyboard? Could you please post the output of sudo evtest
. Whether the keyboard registers multiple devices and which functionality these have. Thanks!
In 2.1.2 a mistake slipped in, so it did not load the config from the .config directory anymore. This was fixed in 2.1.3. But this was unrelated to the issue #29.
My keyboard has several event devices.
/dev/input/event3: Razer Razer BlackWidow Ultimate 2013
/dev/input/event4: Razer Razer BlackWidow Ultimate 2013
/dev/input/event6: Razer Razer BlackWidow Ultimate 2013
And the one that is grabbed (event3
) doesn't seem to ever actually emit any events and the one that does (event4
) seems to be rejected for having EV_ABS
and EV_REL
.
I use the openrazer driver and from what I recall from looking at it last, it mostly just passes events through.
So Razer does some pretty weird stuff with their drivers.
If you don't want just to grab all devices with EV_KEY
or something, perhaps a blacklist or whitelist is needed.
In 2.1.2 a mistake slipped in, so it did not load the config from the .config directory anymore. This was fixed in 2.1.3. But this was unrelated to the issue #29.
Sorry my bad. I'll delete it 😅
Additionally, In my case, while debugging keymapperd
I noticed that the mappings don't work if my config has_mouse_mappings()
. It looks like this is because extra event devices are selected and only events from one device are mapped?. Perhaps mapping events from all grabbed devices if the device is unspecified is necessary to support some devices.
and in my case, I think all devices with the matched name would work.
/dev/input/event3: Razer Razer Naga 2014
/dev/input/event4: Razer Razer Naga 2014
/dev/input/event5: Razer Razer Naga 2014
I noticed that RegEx isn't implemented for device names, perhaps a short-term fix could be to allow RegEx matching some specific event device?
Thank you for your thorough report!
If you don't want just to grab all devices with EV_KEY or something, perhaps a blacklist or whitelist is needed.
I did not want to grab devices with EV_ABS because I thought that only joysticks,... had these and I suspect that it is not so easy to forward them correctly. Maybe I could also get my hands on such a device and implement it properly. This would likely fix this issue.
Perhaps mapping events from all grabbed devices if the device is unspecified is necessary to support some devices.
That is how it is supposed to work. Mice are only grabbed when mappings exist. But I can see in your log:
Received configuration
Mouse usage in configuration changed
Received contexts (0)
Connection to keymapper reset
that it set zero active contexts, which is quite suspicious. I will investigate how this is possible.
Thanks!
I did not want to grab devices with EV_ABS because I thought that only joysticks,... had these and I suspect that it is not so easy to forward them correctly.
In the case of my devices, I think that is just Razer just misreporting devices because no matter what I press that event device doesn't actually emit any events for me. I was just saying if other devices misreport their capabilities that might be an issue.
But I can see in your log:
Received configuration Mouse usage in configuration changed Received contexts (0) Connection to keymapper reset
that it set zero active contexts, which is quite suspicious. I will investigate how this is possible.
Oh, I hadn't noticed that, Just so you know. I don't think it's directly related to the mappings not working when has_mouse_mappings()
is detected.
just ran the test again, albeit without --update
to keymapper
and the test failed without emitting that log.
Sorry, completly forgot about this issue. I can confirm this is a Razer problem. The razerkbd driver from openrazer cause the issue. When unloading it (rmmod razerkbd
) the keymapper works fine.
Maybe I could also get my hands on such a device and implement it properly. This would likely fix this issue.
After further investigation, I believe that this would fix this issue (at least in my case).
Also, It looks like Xbox 360 controllers have functioning EV_ABS
inputs if you're looking for just any device.
For completeness, I believe it would also be possible to remove EV_ABS
for a device when using razerkbd
. But my understanding is that for most devices "reasonable" defaults are used, so every razer keyboard that doesn't have a volume dial or something would need to be added individually.
Is it also possible that this should be fixed on openrazers side? I don't know if this is clear, but razerkbd is an inofficial driver from openrazer. AFAIK it should only control RGB, I don't know why it is messing with keystrokes
From what I know, Typically openrazer
just handles RGB and passes through the rest essentially. However, In some cases, it can do more elaborate stuff like map the mouse wheel tilt to scroll horizontally.
Only briefly looking into it it looks like the part that is messing with keymapper
should only occur for keyboards that have something like a volume wheel. In my case with my keyboard that doesn't have this wheel, it could be a bug in openrazer
that maps the wrong part, or Razers firmware could just be enabling stuff it doesn't actually use on my keyboard.
So it's possible, but some keyboards do appear to use the part that messes with keymapper
validly, so this bug here would exist in that case.
@G-M0N3Y-2503 thanks for the clarification. I also think that openrazer
simply announces the functionality of all potential devices, which is usually not a problem.
Soon I will try to make the virtual keymapper device announce the EV_ABS
events of all grabbed devices and forward these input events. I have a Wacom tablet, which also has such inputs, so I should be able to properly test it.
Version: 1.10.0 OS: Manjaro, installed from AUR
keymapper -v output:
sudo keymapperd -v output:
Config file:
But no keys are mapped, they just behave like normal.