I did not had the chance to have a HP laptop in my hands yet (however I have no hope that will make this Fn-lock magically work as others pointed out).
Anyway , I tried to hack usbkbd.c to put the KB in simple boot mode, see my hacked module here for those that are brave enough (is based on latest linux kernel version plus some small patch):
https://github.com/cgm999/hp-pavilion-usb-linux
F1 to F12 should work,also the normal modifiers as well. The right key "| \" will not work if combined with F1-F12 , I think is possible to transform it to a CTRL modifier in usbkbd.c driver, if there is interest I guess I can give it a try.
One issue is .. mouse is no longer working via the HID interface. One can use the usbmouse.c (from https://github.com/torvalds/linux/blob/ … usbmouse.c ) , however the wheel is not working . No idea how to fix that.. I also do not care much since I have some other mouse to use instead.
EDIT:
I forgot to say that usbhid needs to exclude this device in order for usbkbd.ko to take over
# cat /etc/modprobe.d/usbhid.conf
options usbhid quirks=0x0461:0x4e90:0x0004
I did realize that even multi op codes might be remapped .. I am thinking from a a custom hid kernel driver (like hid-primax.c). There is one catch,for f8..f12 (which set a modifier, is not going to set alt/ctrl ).
]]>Hope someone with a similar HP KB that I have and a HP laptop can put a light on this, is fn lock controlled by BIOS ?
]]>As for remap. the problem is .. F1 to F6 are easy since they send just 1 opcode,and I am doing already . Problem is with the others that send 2 or 3 opcodes.
Again, I am asking for someone with a HP laptop and a HP wireless keyboard to first confirm that indeed changing Action keys (or whatever the term is ) in BIOS is also setting the wireless keyboard. If that is true then I guess we can try to capture some USB packets when the usb wireless dongle is plugged in
]]>Otherwise you'll have to resort to https://wiki.archlinux.org/title/Map_sc … Using_udev or eg. just xmodmap to turn the media keys into F1 keys and vice versa.
]]>On "controlling" it.. I did figure that when keyboard is in simple boot protocol(like in BIOS which implements a limited usb stack) is going to send the normal op codes for Function keys ,problem is releasing ATL/CTRL just when the key is pressed so you can not do alt-f1 and etc
]]>What's the *exact* model of the keyboard in question?
]]>I have a HP wireless pavilion keyboard/mouse combo and for those that do not know the function keys do not send F1 / F2.. instead they send media keys unless you press Fn (and the F1.. key).
Apparently if one have a HP laptop ,from BIOS the action keys can be disabled or enabled,which turns off this madness.
I am asking for help from the whoever owns a HP laptop that have this "Action keys" or similar setting in BIOS and also a HP wireless keyboard and can try to capture the USB packets
when the keyboard is plugged in. Also confirm that indeed is working for the HP wireless keyboard as well..not just the laptop builtin keyboard.
Basically I want to figure out if we can send some custom control/setup packets via USB that does this Fn disable for this HP wireless keyboards.
Thank you in advance for those that offer to help.
]]>