For some reason, Microsoft has equipped their keyboards with an annoying F-lock key. If you hit this key by accident, the F1-F12 keys change their function in things like Undo, Redo, New, Open, etc. Those are all actions that already have shortcuts.
I think this keyboard is broken by design, so I decided to fix it. When I disable F-lock now, it is automatically re-enabled after 3 seconds by a little piece of hardware in the keyboard itself.
I was looking for a software fix and I found Jason Tsangs website. His fix involves overwriting the commands.xml file in your Intellitype folder to completely get rid of the special functions, even when F-lock is disabled. The original (not hacked) xml file in his archive was smaller than my original file and it seemed a bit outdated. After reinstalling or updating Intellitype you would have to go through the process again. So I decided to fix the keyboard itself, in hardware.
The keyboard has an indicator LED for F-lock, so getting the status wouldn’t be too hard. What I had to add was an automatic keystroke for the F-lock key when it is turned off by accident.
Taking it apart
There are a lot of screws to remove, but the keyboard comes apart very easily. See the pictures below. I only had my iPhone to take pictures, so they are a bit crappy.
So what’s inside?
Under the hood you’ll find a small circuit board with a keyboard controller and two sheets which form a button matrix. To find out which matrix row and column correspond with the F-lock key I got my multimeter and measured the sheets. The top of the first sheet is all ground. The bottom of this sheet connects to the second sheet when a button is pressed. So I had to measure the bottom of the top sheet and the top of the bottom sheet to find the right tracks to the controller. See the pics below.
Let’s get hacking
The keystroke could not be emulated with a simple transistor (I tried an N-FET and a P-FET), so I used a HEF4016BP, a quad bilateral switch.
The LED’s have a resistor to VDD and are switched to ground when the LED turns on. The cathode of the LED is therefore low when F-lock is on and high when it is off. This signal is used as input for circuit.
My first attempt was to just press the key after a 1 second delay. This does not work. Here’s why:
When you press the F-lock key, F-lock is disabled immediately. After a second the HEF4016BP also presses the key. If you have not released the F-lock button at that time, the button stays active forever while F-lock is still disabled.
To solve this problem I added a 555 timer to press the F-lock key every 3 seconds until it’s on again. The final circuit is shown below. It got a bit more complicated than I anticipated for the following reasons:
- Emulating 555 like behavior with the 4016 didn’t work well, because the switches do not have hard digital transitions. When the capacitor voltage increases the switches open slowly. The circuit reaches an equilibrium state instead of a periodic high-low signal.
- The 555 timer has a minimum duty cycle of 50% when no diodes are used, so I used a 95% duty cycle and inverted the output.
- When the 555 is in reset, the output is LOW, so when inverted this opens the switch. A double switch is used to work around this issue.
The circuit works perfectly: when F-lock is disabled, it is automatically re-enabled after 3 seconds. The special function keys still work if you want to use them. You just have a 3 second time frame to use them. Much better than the default design if you ask me!