Shami's Blog

DevOps because uptime is not optional

Microsoft Keyboard Function Key Fix

I’ve owned a Microsoft MultiMedia Keyboard 1.0A for years now. It’s a well belt keyboard to say the least. Only one problem though, the “F Lock” key. As a Linux user I have no use for the “Special” keys Microsoft added to the keyboard, and the button always starts turned off, no way to fix it.

I used to keep my PC on at all times so I only needed to press that button every couple of months, or when I want to take a screenshot, but now I started to turn it off at night, and having to press that stupid button every time I boot my system is a huge pain in the butt.

I found a fix for it here and thought I should share

 1vi /usr/local/bin/f_lock_fix
 2setkeycodes bb 59 # Help  -> F1
 3setkeycodes 88 60 # Undo  -> F2
 4setkeycodes 87 61 # Redo  -> F3
 5setkeycodes be 62 # New   -> F4
 6setkeycodes bf 63 # Open  -> F5
 7setkeycodes c0 64 # Close -> F6
 8setkeycodes c1 65 # Reply -> F7
 9setkeycodes c2 66 # Fwd   -> F8
10setkeycodes c3 67 # Send  -> F9
11setkeycodes a3 68 # Spell -> F10
12setkeycodes d7 87 # Save  -> F11
13setkeycodes d8 88 # Print -> F12
14chmod 700 /usr/local/bin/f_lock_fix

Now add this to your startup file “/etc/rc.local” or equivalent

1if [ -x /usr/local/bin/f_lock_fix ]; then
2	echo "Fixing the F-Lock scan codes for F1-F12 keys...";
3	/usr/local/bin/f_lock_fix;
4fi

About Me

Dev gone Ops gone DevOps. Any views expressed on this blog are mine alone and do not necessarily reflect the views of my employer.

Categories