12

I tried using DoubleCommand, but it doesn't let you hold down caps lock, and pressing it causes caps lock light to be enabled/disabled. Ideally I want caps lock to never be enabled and for the key to behave exactly as though it were the delete key.

Another problem that DoubleCommand has is that every second press just toggles the light, and doesn't delete a character.

5 Answers 5

13

You may want to try Karabiner-Elements (formerly Seil). I use it to bind Caps Lock to Right-Ctrl (not plain Ctrl), so that I can bind Caps Lock to Meta in Emacs (while Ctrl remains Ctrl, and other keys are kept to the usual behavior).

5
  • This works, thanks. To make sure that there is no delay though, you'll want to install and use KeyRemap4MacBook as well (same website). The instructions are located here: pqrs.org/macosx/keyremap4macbook/extra.html#t1
    – Senseful
    Commented Jan 29, 2011 at 22:22
  • 2
    on my newer macbook, all I needed to do was use Keyboard preferences to disable caps lock, and then install PCKeyboardHack to map caps lock (I mapped it to Esc for use in vim) Commented Jan 29, 2011 at 22:35
  • Indeed I do not have any delay when you remapping (or disabling I guess) Caps Lock in the System Preferences > Keyboard Preference Pane > Modifier Keys… popup. Commented Jan 30, 2011 at 2:53
  • 2
    The application has been renamed "Seil": pqrs.org/osx/karabiner/seil.html.en Commented Aug 10, 2014 at 11:39
  • 1
    Seil is now obsolete and has been replaced by Karabiner-Elements.
    – syvex
    Commented Mar 24, 2020 at 16:11
16

If you're on macOS Sierra or later, and don't mind using the command line, you can do it with a technique I saw on Hang Lu Su's blog:

$ hidutil property --set '{"UserKeyMapping":[{"HIDKeyboardModifierMappingSrc":0x700000039,"HIDKeyboardModifierMappingDst":0x70000002A}]}'

In her linked post she gets into other things as well, like making sure this binding survives restarts or mapping any key. Here are the Apple docs explaining the technique used as well as the codes to use for any key.

I realize the question and its original answers are older than macOS Sierra, but perhaps this can be useful for people stumbling across it more recently.

5
  • the link to the blog is now broken :( Commented Dec 3, 2021 at 5:27
  • 1
    @sevenseacat Thanks for the heads up. I've now updated the link. Hopefully it will be visible shortly after a review. Commented Dec 4, 2021 at 17:33
  • Thanks! How is it possible to keep these changes after Mac reboot? Commented Nov 29, 2023 at 14:41
  • @artnikbrothers Check the link to Hang Lu Su's blog given in the body of the answer. There's a section titled "Keeping the Change on Restart". Essentially you just need a way to run the given command upon restart. A login script is one way to do it, and there might be more. Commented Dec 1, 2023 at 16:53
  • This works better than Karabiner Elements. Karabiner requires you to release backspace before pressing the caps lock key, but this solution doesn't. You can alternate between them and be sloppy. Thank you very much.
    – Patrick
    Commented Feb 22 at 18:10
2

This is trivial with Karabiner-Elements:

  1. Go to Karabiner Elements Preferences
  2. Simple Modifications tab
  3. Add Item
  4. From: caps_lock To: delete_or_backspace

That's it - the change should apply instantly.


You may also want to remap Backspace temporarily to nothing, to make sure you get the new muscle memory and not the old habitual key. In that case, do the same as above but remap From: delete_or_backspace, To: vk_none (disable this key).

enter image description here

1

Seil is now obsolete and has been replaced by Karabiner-Elements. https://karabiner-elements.pqrs.org

0

ControllerMate gets normal auto-repeat, no delay nor light toggle given Apple ➤ System Preferences… ➤ Keyboard ➤ Keyboard ➤ Modifier Keys… ➤ Caps Lock Key ➤ No Action.
Control, Meta (Alt) and Control-Meta took extra logic: ControllerMate's wacky visual programming language

       Peace
            —Devon

P.S. Emacs² & Lisp³ grew up with Rubout left of letter A — see the Knight TV keyboard⁴ and Space Cadet keyboard⁵ layouts with Control-Meta-Super-Hyper-Shift-Greek-Top modifier keys.

P.P.S. Password input may require the hardware delete key.

P.P.P.S. If you manage to get caps lock functionality on a both-shifts key chord do let me know.

P.P.P.P.S. The Mgt forbids me to post these https://en.wikipedia.org/wiki/ links: [2] Emacs [3] Lisp_(programming_language) [4] Knight_keyboard [5] Space-cadet_keyboard

1
  • I flushed ControllerMate in favor of Karabiner-Elements as suggested in other answers — configuration is daunting but I believe a third party app helps overcome this obstacle.
    – Devon
    Commented Jul 26, 2020 at 3:45

You must log in to answer this question.

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