9

I replaced standard fn key by left control, left control by another useful key.

And as far as I don't use Caps Lock key in everyday life, I decided to replace Caps Lock key by fn.

I use for this purpose PCKeyboardHack.

change Caps Lock to fn key in PCKeyboardHack

I just inputed number 63 (which corresponds to fn) in Change Caps Lock row.

But now my Caps Lock don't do nothing: neither CapsLocking nor fn key work.

When I change Caps Lock key by forward delete for example (117 code) - it is ok. And Caps Lock starts work as forward delete key.

change Caps Lock to forward delete in PCKeyboardHack

But I need to set fn to Caps Lock key.

UPDATE

I have noticed in KeyRemap4MacBook EventViewer: when I press Caps Lock...

KeyRemap4MacBook EventViewer

... I get control_l keycode. But in fact it don't work even as control_l (I checked).

Why it shows control_l? Maybe because I have changed fn key to left control in KeyRemap4MacBook app.

fn to control_l in KeyRemap4MacBook

When I uncheck this checkbox and watch in EventViewer on Caps Lock clicking again: I see Fn code on output.

fn logged in eventViewer but in fact not working

But in fact it does not work as Fn (I check it on fn+delete)

Update 2

I disabled CAPS LOCK

CAPS LOCK - no action

In PCKeyboardHack set F19 to Caps Lock

F19 to Caps LOCK

In KeyRemap4MacBook remap F19 to fn

<item>
    <name>f19_to_fn</name>
    <identifier>f19_to_fn</identifier>
    <autogen>__KeyToKey__ KeyCode::F19, KeyCode::FN</autogen>
</item>

enable f19 to fn in PCKeyboardHack

And now Caps Lock works as fn except f1 - f12 keys. For example when I press default fn + f11 I see Launchpad. When I press remapped fn + f11 I see volume down. So f11 not working with remapped fn.

In other combinations like fn + delete = forward delete remapped fn works well.

  • Are you pressing an actual function key (F1-F19) with the function key (FN)? normally for it to work you need to press FN + F1-19. – l'L'l Dec 24 '13 at 5:17
  • yes I test fn key with forward delete. I press fn + delete. When I have standard fn key I can forward delete and when I set caps lock to fn key, I cannot forward delete pressing caps lock + backspace – Maxim Yefremov Dec 24 '13 at 9:02
3
+50

Just changing caps lock to key code 63 with PCKeyboardHack works for me. Have you tried setting caps lock no action from System Preferences?

You could also try to use PCKeyboardHack to for example change caps lock to F19 and then use a private.xml like this with KeyRemap4MacBook:

<?xml version="1.0"?>
<root>
  <item>
    <name>test</name>
    <identifier>test</identifier>
    <autogen>__KeyToKey__ KeyCode::F19, KeyCode::FN</autogen>
  </item>
</root>
  • Thank you! Caps Lock to fn works except f1 - f12 keys (Please see update 2) – Maxim Yefremov Dec 30 '13 at 4:56
1

Brett Terpstra covered this in a December 2012 article about remapping the caps lock key.

http://brettterpstra.com/2012/12/08/a-useful-caps-lock-key/

0

Apple has posted a Note on Key Remapping for macOS 10.12, which can be found here: https://developer.apple.com/library/content/technotes/tn2450/_index.html

On this page, you can find a terminal command as well as a chart of all the button values.

And if you are into programming, they even provide a little Objective-C code example.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .