Skip to content
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

Logi G305 conflict with keyd #439

Closed
mikdmst1 opened this issue Feb 19, 2023 · 14 comments
Closed

Logi G305 conflict with keyd #439

mikdmst1 opened this issue Feb 19, 2023 · 14 comments
Labels

Comments

@mikdmst1
Copy link

i have this bug
https://bbs.archlinux.org/viewtopic.php?id=273114
and stopping keyd.service fixed this
after starting service again - mouse lost

can u fix this?

forum say: "It probably manages the device because it thinks it's a keyboard - try to stop the daemon and see…"

@TravisRoad
Copy link

same problem with g304

and libinput debug-gui shows error when I move the mouse.

event17 - keyd virtual pointer: Unexpected event type EV_REL (0x2)

@TravisRoad
Copy link

btw, I unplug the g304 receiver, and use the command lsusb | cut -f6 -d' ' | grep ':' get the whitelist ids.

$ lsusb | cut -f6 -d' ' | grep ':'
2109:0817
1d6b:0003
13d3:56ba
2109:2817
...

After that, I put these line to the [ids] section to solve this problem temporarily.

@ineu
Copy link

ineu commented Feb 20, 2023

The same happens with MX Master 3. Started in the last few days, might be related to the recent linux or linux-firmware upgrades.

@maosocial
Copy link

btw, I unplug the g304 receiver, and use the command lsusb | cut -f6 -d' ' | grep ':' get the whitelist ids.

$ lsusb | cut -f6 -d' ' | grep ':'
2109:0817
1d6b:0003
13d3:56ba
2109:2817
...

After that, I put these line to the [ids] section to solve this problem temporarily.

follow your steps, but not work, anything I missing?

@rvaiya
Copy link
Owner

rvaiya commented Feb 22, 2023

My guess is that it recognizes the mouse as a keyboard since it probably has the ability to send key events. The solution is to explicitly blacklist it in your config (or explicitly whitelist everything else as above). You can achieve this by adding -<mouse id> to the [ids] section.

@maosocial
Copy link

My guess is that it recognizes the mouse as a keyboard since it probably has the ability to send key events. The solution is to explicitly blacklist it in your config (or explicitly whitelist everything else as above). You can achieve this by adding -<mouse id> to the [ids] section.

@rvaiya hi rvaiya, I tried this way but failed, hope you can help me. I do the following:

$ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 005: ID 8087:0a2b Intel Corp. Bluetooth wireless interface
Bus 001 Device 004: ID 0bda:5650 Realtek Semiconductor Corp. Integrated Webcam_HD
Bus 001 Device 007: ID 1a81:1217 Holtek Semiconductor, Inc. ikbc Keyboard
Bus 001 Device 006: ID 046d:c53f Logitech, Inc. USB Receiver
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

I think the 046d:c53f is the id, so I put it into the [ids] section, looks like:

[ids]

*
-046d:c53f

then I tried sudo keyd reload or sudo systemctl restart keyd.service, I even reboot, none works.
any suggestions?

@maosocial
Copy link

My guess is that it recognizes the mouse as a keyboard since it probably has the ability to send key events. The solution is to explicitly blacklist it in your config (or explicitly whitelist everything else as above). You can achieve this by adding -<mouse id> to the [ids] section.

@rvaiya hi rvaiya, I tried this way but failed, hope you can help me. I do the following:

$ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 005: ID 8087:0a2b Intel Corp. Bluetooth wireless interface
Bus 001 Device 004: ID 0bda:5650 Realtek Semiconductor Corp. Integrated Webcam_HD
Bus 001 Device 007: ID 1a81:1217 Holtek Semiconductor, Inc. ikbc Keyboard
Bus 001 Device 006: ID 046d:c53f Logitech, Inc. USB Receiver
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

I think the 046d:c53f is the id, so I put it into the [ids] section, looks like:

[ids]

*
-046d:c53f

then I tried sudo keyd reload or sudo systemctl restart keyd.service, I even reboot, none works. any suggestions?

I finally solved it. the mouse device id I metioned above is not correct.
by $ journalctl -eu keyd , I get the following, and the 046d:4074 is what I need.

Feb 22 15:30:07 arch-d keyd[5048]: DEVICE: match    046d:4074  /etc/keyd/keyd.mkeys.conf        (Logitech G304)
Feb 22 15:30:07 arch-d keyd[5048]: DEVICE: ignoring 0000:0000  (ST LIS3LV02DL Accelerometer)
Feb 22 15:30:07 arch-d keyd[5048]: DEVICE: ignoring 044e:120b  (DLL07A7:01 044E:120B)

so I reedit the ids section in keyd config file, looks like:

[ids]

*
-046d:4074

and it works. hope it help someone else.

@rvaiya
Copy link
Owner

rvaiya commented Feb 22, 2023

For future reference, you can find the original device id by using keyd monitor. If keyd is not already running it will print output events from the original input devices in real time along with the corresponding ids.

@tarik02
Copy link

tarik02 commented Feb 23, 2023

Similar issue happens to me (event25 - keyd virtual pointer: Unexpected event type EV_REL (0x2)). I have A4Tech X7 mouse. I added it's id to config because I need to remap buttons on this mouse.

Issue starts from version v2.4.1. I just rolled back to v2.4.0 for now.

@into-the-v0id
Copy link

Im having a similar problem. After updating my system my mouse pointer fails to move.

Mouse model:

$ sudo keyd --monitor
device added: 1b1c:1b2e (Corsair Corsair Gaming M65 Pro RGB Mouse)
$ lsusb
Bus 001 Device 006: ID 1b1c:1b2e Corsair Corsair Corsair Gaming M65 Pro RGB Mouse

Running libinput with keyd running:

$ sudo libinput debug-events
-event6   DEVICE_ADDED            Corsair Corsair Gaming M65 Pro RGB Mouse seat0 default group6  cap:p left scroll-nat scroll-button
-event24  DEVICE_ADDED            keyd virtual device               seat0 default group13 cap:k
-event25  DEVICE_ADDED            keyd virtual pointer              seat0 default group14 cap:P buttons:17 strips:0 rings:0 mode groups:1
event25 - keyd virtual pointer: Unexpected event type EV_REL (0x2)
event25 - keyd virtual pointer: Unexpected event type EV_REL (0x2)
event25 - keyd virtual pointer: Unexpected event type EV_REL (0x2)
event25 - keyd virtual pointer: Unexpected event type EV_REL (0x2)

Running libinput with keyd stopped:

$ sudo libinput debug-events
-event6   DEVICE_ADDED            Corsair Corsair Gaming M65 Pro RGB Mouse seat0 default group6  cap:p left scroll-nat scroll-button
-event6   POINTER_MOTION          +0.000s	  0.30/  0.00 ( +1.00/ +0.00)
 event6   POINTER_MOTION          +0.002s	  0.00/ -0.91 ( +0.00/ -1.00)
 event6   POINTER_MOTION          +0.006s	  1.02/  0.00 ( +1.00/ +0.00)
 event6   POINTER_MOTION          +0.009s	  1.00/  0.00 ( +1.00/ +0.00)

The system update (Arch Linux) included systemd v253-1. After downgrading systemd to v252.5-1 it seems to work again.

Im running GNOME on Wayland. Linux 6.1.12-arch1-1 x86_64

@rvaiya
Copy link
Owner

rvaiya commented Feb 23, 2023

Mouse support is currently experimental as handling mouse events is non trivial. keyd can't exclusively remap button events, it must also handle motion events, which are far more complex and have a bunch of vendor specific quirks (why libinput exists).

This is why keyd tries to avoid managing mice by default, but if your mouse is able to emit key events (e.g The MX Master 3) keyd will treat it as a keyboard and require you to explicitly blacklist the id as above. Right now button remapping only works for the subset of mice (mainly trackpads) that keyd can handle properly, so if your goal is to remap your mouse buttons using keyd, you are probably out of luck. I plan on improving support for this in the future.

@tkna91
Copy link
Contributor

tkna91 commented Mar 7, 2023

Fix #441 0fb86d3 makes my mouse pointer and leftmouse rightmouse etc mapping work!

$ sudo keyd monitor
device added: 047d:8018 Kensington Expert Wireless TB Mouse (/dev/input/event23)
device added: 047d:1020 Kensington      Kensington Expert Mouse (/dev/input/event15)
$ 

@rvaiya
Copy link
Owner

rvaiya commented Mar 7, 2023

@tkna91 Thanks for the data point.

0fb86d3 will fix a subset of these issues, since it addresses a change in udev that recently broke the existing mouse functionality, but there will still be some mice that don't work. YMMV.

@tarik02
Copy link

tarik02 commented Mar 7, 2023

@tkna91 Thanks for the data point.

0fb86d3 will fix a subset of these issues, since it addresses a change in udev that recently broke the existing mouse functionality, but there will still be some mice that don't work. YMMV.

Works for me! Thank you!

@rvaiya rvaiya added the mouse label May 27, 2023
@rvaiya rvaiya closed this as completed May 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

8 participants