I have a broken key on my Mac's keyboard and I need to remap it to some other key, by double press. Temporarily.

It's not a special but an alphabet letter one. I want to remap it this way:

"f" (broken) --> "double a"

How can one do it? Preferably without any third-party tool.


This hasn't worked - double a won't get replaced with f whenever I type "aa" anywhere on my laptop. I want it to replace double a with f on the fly.

enter image description here

  • 3
    If any third party tool is accepted, I would suggest Karabinar-Elements or HammerSpoon.
    – Tun
    Oct 9, 2020 at 15:27
  • Does this answer your question? Remap CapsLock to Delete on Sierra
    – Allan
    Oct 10, 2020 at 2:22
  • There are many existing questions/answers on remapping keys; many refer to 3rd party tools, but also show how to do this with the built in tool hidutil. The linked dupe is just one. Give that a go and update how that works out for you.
    – Allan
    Oct 10, 2020 at 2:25
  • "This hasn't worked - double a won't get replaced with f whenever I type "aa"" Which app did you try it in ? works for me in say Safari search bar
    – anki
    Oct 10, 2020 at 6:16
  • @anki why do you need the name of an app? there're millions of them
    – kosmosu05
    Oct 10, 2020 at 6:41

1 Answer 1


If the broken key is one of the characters, not function, or modifier keys:

Set up a text replacement for say ZZ -> A (broken key).

System preferences > Keyboard > Text.

Word and other non-Apple apps can have their own text-replacement preferences that would have have to be set.

A long-winded way is to set up a "Service" or a Script Editor's "Script" to keystroke the key you need.

  • System preferences > Keyboard > Text. --> and?
    – kosmosu05
    Oct 10, 2020 at 3:25
  • @kosmosu05 Add a text replacement .. See edited answer
    – anki
    Oct 10, 2020 at 6:14
  • 1
    This will only work in Cocoa based apps. For instance, it will work in Pages, but not in Word.
    – Allan
    Oct 11, 2020 at 15:51
  • @Allan But Word has its own settings for this, no problem to do it there. Nov 10, 2020 at 15:21

You must log in to answer this question.

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