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

Logitech MX Keys with Unifying receiver does not provides a /dev/input/by-id entry #16

Open
frague59 opened this issue Jun 8, 2020 · 4 comments

Comments

@frague59
Copy link

frague59 commented Jun 8, 2020

Hi,

I've recently received a Logitech MX Keys keyboard (I'm a lucky man...), but this keyboard does not set any entry in the /dev/input/by-id, so I can not set a device in the netevent configuration file.

Have you any idea on how I can use netevent with this device ?

Thanks !

@frague59
Copy link
Author

frague59 commented Jun 8, 2020

Additional infos:

I can see it here:

cat /proc/bus/input/devices
I: Bus=0003 Vendor=046d Product=408a Version=0111
N: Name="Logitech MX Keys"
P: Phys=usb-0000:00:14.0-8.2/input2:1
S: Sysfs=/devices/pci0000:00/0000:00:14.0/usb1/1-8/1-8.2/1-8.2:1.2/0003:046D:C52B.0003/0003:046D:408A.0004/input/input20
U: Uniq=408a-4f-b5-e2-0d
H: Handlers=sysrq kbd leds mouse0 event4 
B: PROP=0
B: EV=12001f
B: KEY=3f000301ff 0 0 483ffff17aff32d bfd4444600000000 ffff0001 130ff38b17c007 ffff7bfad941dfff ffbeffdfffefffff fffffffffffffffe
B: REL=1943
B: ABS=100000000
B: MSC=10
B: LED=1f

@frague59
Copy link
Author

frague59 commented Jun 8, 2020

I've set directly the /dev/input/event4 into the netevent.n2e file, it works for now, but I'm not sure this event device handler is static (maybe it'll change after a reboot...)

Thanks for this great soft !

@kokoko3k
Copy link

kokoko3k commented Jun 8, 2020

I use netevent into an home-made remote desktop script i made.
https://github.com/kokoko3k/ssh-rdp

And i faced your same issue; i tried that way:

events_from_name(){
    #es: events_from_name "Logitech G203 Prodigy Gaming Mouse"
    #event13
    #event2
    grep 'Name=\|Handlers' /proc/bus/input/devices|grep -A1 "$1"|cut -d "=" -f 2 |grep -o '[^ ]*event[^ ]*'
}

...yes, multiple events could be bound to a "single" device, i just forward every event it returns.

and yes, it is a bit hacky, but since the kernel does not break userspace, i think it will work in the future too.
If you find a better way, please, ping me back ;-)

@Blub
Copy link
Owner

Blub commented Aug 20, 2020

Sorry for the late reply. Have you looked at https://github.com/Blub/netevent/blob/master/examples/laptop-and-vm-with-systemd/70-input-names.rules ? The N: Name="Logitech MX Keys" portion should be usable in an udev rule the same way as the linked file matches for vm-*.
You may need to change up the /dev/input/by-name part to filter out unwanted characters (which could be handled in the PROGRAM line already I think.
And with the TAG+="systemd" you also get a .device systemd unit you can use to depend on in case you want to start netevent via a service.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants