JohnJohanssonChalmers / hp_wireless_keyboard

Adapted from https://github.com/y-trudeau/linux_lenovo_ultraslim_plus.
GNU General Public License v2.0
16 stars 7 forks source link

Problem with USB network adapter #12

Open johansmitsnl opened 5 years ago

johansmitsnl commented 5 years ago

It tries to catch all input from the monitor in this line: https://github.com/JohnJohanssonChalmers/hp_wireless_keyboard/blob/b544ec37eb94d84ceb6db34ea2ab66a86095f919/hp_keyboard.sh#L3

I had to change the line to just /sys/kernel/debug/usb/usbmon/3u because my system was parsing input from my USB network adapter.

Is there a way to detect the proper usb device to which should be monitored?

xloss commented 5 years ago

The same problem only with the external drive. Solved it by editing the regular expression. Here is the line: stdbuf -i0 -o0 -e0 grep -h -Po '\K[8]+ = [0-9a-f]{8} 00000000$' /sys/kernel/debug/usb/usbmon/*u | stdbuf -i0 -o0 -e0 tr -d ' ' | /usr/local/bin/kbdusb

Keyboard use only 16 byte. First 8 byte on key code, second 8 byte always zeros.

P.S. HP Pavilion Wireless Keyboard and Mouse 800