Open hrimfaxi opened 8 years ago
Addition: seems only tp-compact-usb-keyboard.c works.
Okay, makes sense that only tp-compact-usb-keyboard works, given it's the same with the Lenovo USB keyboard I have. You could copy the top of the script into a new script that wraps around tp-compact-usb-keyboard.c
if you wanted the auto-keyboard-finding functionality. Ideally we'd poke support for the keyboard into the Linux kernel though.
What hidraw device are you sending commands to, hidraw2 or hidraw3 (assuming you haven't unplugged anything since the above dmesg)? I'm guessing (well, more hoping) that it's the latter device, hidraw3, that works. Do all the special Fn-Key functions work properly if you use evtest
on the linux console (i.e. outside X11)? Some might only be available on the second input device for the keyboard.
Does the keyboard have a pointing device of some kind too? It's hard to find out any information on it, best I can do is guess that it's the keyboard pictured here: http://www.newegg.com/Product/Product.aspx?Item=N82E16883108568
Yeah I already done that part for udev to call tp-compact-usb-keyboard.
Either hidraw2 or hidraw3 works if I unplugged then plugged it back. It works even only one single hidraw device was given to tp-compact-usb-keyboard.
This keyboard have no pointing device. It was the keyboard shipped with Lenovo server and PC sold in China. And quickly became a nightmare for people working on Linux with it.
Here is some photo: http://i.imgur.com/RS4TRMc.jpg http://i.imgur.com/QjF3gfQ.jpg
Here is the result of xev | grep --line-buffered -A6 KeyRelease after running tp-compact-usb-keyboard /dev/hidraw3: I think from F1 to F12 all keys are unlocked.
--
KeyRelease event, serial 37, synthetic NO, window 0x2200001,
root 0xd4, subw 0x0, time 77428490, (-131,235), root:(740,714),
state 0x0, keycode 67 (keysym 0xffbe, F1), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
KeyPress event, serial 37, synthetic NO, window 0x2200001,
--
KeyRelease event, serial 37, synthetic NO, window 0x2200001,
root 0xd4, subw 0x0, time 77429010, (-131,235), root:(740,714),
state 0x0, keycode 68 (keysym 0xffbf, F2), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
KeyPress event, serial 37, synthetic NO, window 0x2200001,
--
KeyRelease event, serial 37, synthetic NO, window 0x2200001,
root 0xd4, subw 0x0, time 77429690, (-131,235), root:(740,714),
state 0x0, keycode 69 (keysym 0xffc0, F3), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
KeyPress event, serial 37, synthetic NO, window 0x2200001,
--
KeyRelease event, serial 37, synthetic NO, window 0x2200001,
root 0xd4, subw 0x0, time 77430754, (-131,235), root:(740,714),
state 0x0, keycode 70 (keysym 0xffc1, F4), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
KeyPress event, serial 37, synthetic NO, window 0x2200001,
--
KeyRelease event, serial 37, synthetic NO, window 0x2200001,
root 0xd4, subw 0x0, time 77431314, (-131,235), root:(740,714),
state 0x0, keycode 71 (keysym 0xffc2, F5), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
KeyPress event, serial 37, synthetic NO, window 0x2200001,
--
KeyRelease event, serial 37, synthetic NO, window 0x2200001,
root 0xd4, subw 0x0, time 77432098, (-131,235), root:(740,714),
state 0x0, keycode 72 (keysym 0xffc3, F6), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
KeyPress event, serial 37, synthetic NO, window 0x2200001,
--
KeyRelease event, serial 37, synthetic NO, window 0x2200001,
root 0xd4, subw 0x0, time 77432674, (-131,235), root:(740,714),
state 0x0, keycode 73 (keysym 0xffc4, F7), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
KeyPress event, serial 37, synthetic NO, window 0x2200001,
--
KeyRelease event, serial 37, synthetic NO, window 0x2200001,
root 0xd4, subw 0x0, time 77433587, (-131,235), root:(740,714),
state 0x0, keycode 74 (keysym 0xffc5, F8), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
KeyPress event, serial 37, synthetic NO, window 0x2200001,
--
KeyRelease event, serial 37, synthetic NO, window 0x2200001,
root 0xd4, subw 0x0, time 77434186, (-131,235), root:(740,714),
state 0x0, keycode 75 (keysym 0xffc6, F9), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
KeyPress event, serial 37, synthetic NO, window 0x2200001,
--
KeyRelease event, serial 37, synthetic NO, window 0x2200001,
root 0xd4, subw 0x0, time 77434874, (-131,235), root:(740,714),
state 0x0, keycode 76 (keysym 0xffc7, F10), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
KeyPress event, serial 37, synthetic NO, window 0x2200001,
--
KeyRelease event, serial 37, synthetic NO, window 0x2200001,
root 0xd4, subw 0x0, time 77436218, (-131,235), root:(740,714),
state 0x0, keycode 95 (keysym 0xffc8, F11), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
KeyPress event, serial 37, synthetic NO, window 0x2200001,
--
KeyRelease event, serial 37, synthetic NO, window 0x2200001,
root 0xd4, subw 0x0, time 77437002, (-131,235), root:(740,714),
state 0x0, keycode 96 (keysym 0xffc9, F12), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
Hi, I found out this utility even works with lenovo USB keyboard LXH-JME2209U. My Fn lock is successfully unlocked! Nice work! However, its HID_NAME was "Lenovo Lenovo USB Keyboard". Maybe you could handle it too in the script.
dmesg:
lsusb -v: