How to enable key repeating in macos

macOS has the accent keys feature, which makes it easier for users to add alphabets accent marks by pressing and holding an alphabet key. While this is useful for people who use them, it is also an inconvenience for users who don’t as because of accent keys you cannot enter letters repeatedly by holding down an alphabet button. If you want to change this behavior of your Mac and disable accent keys, then we have got your covered. To do so all you need to do is enter a Terminal command and reboot your computer.

Disable macOS Accent Keys and Enable Key Repeat

Important: Before following the steps below make sure you have configured the key repeat settings correctly as detailed here.

Step 1: On your Mac launch the Terminal application. Make sure you have administrative privileges to your computer. If not, then sign in with an admin account.

Step 2: Once Terminal is launched copy and paste the following command and hit the ‘Return’ key.

defaults write -g ApplePressAndHoldEnabled -bool false

Step 3: Once the command has been entered reboot your Mac.

After the reboot when you press and hold any alphabet key from your keyboard the key will be entered repeatedly instead of you seeing the accent menu. The speed of key repeat will depend on how you have set it up from Keyboard settings.

How to enable key repeating in macos

Timothy Reavis on January 14, 2015

One thing I’ve always liked about Macs is their secondary keys, where holding down a letter key will display variations of that letter, like holding down “u” to get “ü.” This comes in handy when spelling non-English words, but if that’s not something you ever do, Apple’s substitution of special characters for the traditional key repeats of Windows computers can be an unneeded – and perhaps unwanted – feature.

The good news is that there’s a simple way to take control and change the behavior of long key presses to accommodate your needs. This not only works with letters, but number keys as well.

Enable key repeat on Mac

1) Open Terminal from Spotlight or by locating it in the Applications folder.

2) Enter the following command into Terminal and press enter:

3) Restart any open applications in which you want this setting to activate. You should now be able to hold down a key and have it repeat its character indefinitely.

4) If you want to speed up the rate of key repeats or decrease the delay before a held key starts repeating, System Preferences has these options filed under the Keyboard header. Simply adjust these sliders to suit your taste.

How to enable key repeating in macos

Reverting back: If you don’t like the results or want to get back the alternate characters for whatever reason, doing so is as simple as following the above steps but changing the latter part of the command from “false” to “true”. This simply means substituting the following command for the one in step 2:

That’s all it takes. Whether you like key repeats or simply dislike alternate characters, toggling between these settings is a breeze.

For more, take a look at our keyboard shortcuts section for quicker ways to accomplish tasks on your Mac. And if you have tips like this you’d like to share, leave a comment or hit us up on Twitter!

On a Windows machine, pressing and holding a keyboard key results in the character being repeated. For example, if I press and hold q for a few seconds, I end up with the following:

Similarly, I can press and hold the Backspace key to delete multiple characters.

On a Mac pressing and holding a key for several seconds results in the character being typed only once. To type it repeatedly, it is necessary to physically press it multiple times.

I’m unclear about whether that is a bug or a supposed-feature, but I am interested in replicating this functionality on a Mac.

A couple of notes and additional ideas to supplement the selected answer:

The speed of repetition of characters (how many characters are added per second when a key is held down) can be controlled by adjusting the “Key Repeat” option under System Preferences => Keyboard (Keyboard tab). However, if the fastest speed is not fast enough (it wasn’t for me), you can further adjust this setting by opening Terminal and typing:

Where 0 indicates the minimum speed (smaller is faster). The fastest that can be set by the system preferences is 2 , so the other two remaning, faster options are 1 (fast) and 0 (fastest).

The amount of time it takes for key repetition to begin can also be set by adjusting the “Delay Until Repeat” option under System Preferences => Keyboard (Keyboard tab). Again, if this is still too slow for you (as it was for me), you can set an even faster speed by opening Terminal and typing:

Where 4 , again, can be adjusted (smaller is faster). I’d highly recommend you do not set this option under 4 , though, because that would just be impossibly fast (touching a key for a mere split second would type about 10 repeating characters). I ended up setting mine to 7 , which might still be too fast for me.

March 2, 2012

HOW-TO Disable the Character Accent Menu and Enable Key Repeat in Mac OS X Lion

To disable the press and hold accented character picker you need to digit the following commad in a Terminal window:

After that you will have to Log Out and then Log In again. Or just restart the Mac.

If you want to re-enable the functionality, you need to digit

the Log Out and Log In again.

Comments

Profile cancel

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  • 2 Replies
  • 2 Comments
  • 0 Tweets
  • 0 Facebook
  • 0 Pingbacks

I’ve been trying to sort this for ages now, and you seem to suggest the same “fix” as a gazillion other pages, but it just doesn’t work for me. Personally, I want the accent menu back! I used to have this function when I bought my Macbook Pro a few months and I thought iy was great, but at some point it just disabled itself…so now I’m stuck with key repeat 🙁

Any suggestions/advice would be seriously appreciated.

Hi Nik,
in my personal experience using

defaults write -g ApplePressAndHoldEnabled -bool true

did always the trick to restore the accent menu.

what you may try to do is to append the command ‘sudo’ in this way

sudo defaults write -g ApplePressAndHoldEnabled -bool true

That will execute the command with administrator privileges and may force the update of the configuration file that stores the setting.

I know how to set the key repeat rate using System Preferences > Keyboard but it looks that the fastest settings is not enough.

Is there any way to speed up even more?

I do not know if others encountered the same issue, but I’m using a MacBook Pro, model 2010.

4 Answers 4

You can also change the preference keys by running the following in Terminal:

The changes aren’t applied until you log out and back in. KeyRepeat can’t be set between 2 (30 ms) and 1 (15 ms) though.

I also use KeyRemap4MacBook. I’ve set the repeat rates to 40 ms and the initial repeat rates to 150 ms.

How to enable key repeating in macos

I just discovered that I had KeyRemap4MacBook installed and inside this application you have lots of low level settings for key repeat.

Now I’m happy with 400ms initial repeat time and 20ms repeat wait.

How to enable key repeating in macos

Old post, but this may help someone: If you are using the “Karabiner app” () which is a third party app commonly used to remap keys (or make OS X keyboard mimic some of Windows keyboards behaviors) it will bypass your OS X configurations.

If you are using it, to increase your keyboard rate you should go to the app and on the second tab (“Key Repeat”) you’ll find the option Repeat Rate. Changing that will render immediate effect and, as far as I can tell, it’s the only way to get the repeat rate changed when using this app.

How to enable key repeating in macos

@user495470’s answer is great for native apps, but for whatever reason, it appears to have messed up key repeat for me in XQuartz windows. To work around the issue, I initially ran this in the terminal:

Leaving off the last 2 arguments will reset the system defaults.

I read that you have to run this command every time you run XQuartz anew, but when I put it in my login script, it caused the system to hang on shutdown (until I killed the hung xset commands) and on startup, so I discovered that a better way to change the key repeat setting is to first disable the little bubble menu that appears above a typed character upon press & hold, e.g. hold down the a key and you are presented with a bubble containing alternate ‘a’ characters with various umlauts, accents, etc.

Then run the key repeat commands:

If you do it this way, key repeats will work in XQuartz windows without needing to run xset r # # .

I use the vim plugin and I typically scroll in vim by just holding j. In VSCode holding j just does a single j command, no matter how long it’s held for.

Even in vanilla vscode this also doesn’t work – problematic if you’re trying to type long blocks of ########################### for comment separators. Any idea how to enable this functionality?

9 Answers 9

To disable the Apple press and hold for VSCode only, run this command in a terminal:

Then restart VSCode.

To re-enable, run this command in a terminal:

How to enable key repeating in macos

You are on OSX, correct? If so, the issue might be Apple’s “Press&Hold”, where you can select alternative characters on long presses.

You can disable this “feature” with a defaults command in the terminal:

You have to restart VSCode afterwards.

To reenable the previous behaviour:

How to enable key repeating in macos

The official vim-plugin for VS Code mentions how to set it up on macOS

The answer by Steve above didn’t quite work for me because of global settings. It also left me curious about where to find the com.microsoft.VScode domain name for an app. Here is what worked for me and a generalized formulation:

To enable repeats for a specific app, like VSCode, first make sure that there isn’t an overriding global setting.

defaults delete -g ApplePressAndHoldEnabled

Then enable the setting for the specific app, you can find the domain name of an app by finding it in the Info.plist document under the Contents folder where it is installed.

Then set the setting on the command line.

defaults write com.microsoft.VSCode ApplePressAndHoldEnabled -bool false

You can use this pattern other app specific settings as well. Just make sure that your settings aren’t being overwritten globally.

For more information on defaults type defaults help . One more note, you don’t need to run this as sudo if your user is already an admin.

macOS provides audio feedback for lots of things e.g., when you move files to the trash, when you take a screenshot, or when you connect the power adapter to a MacBook. It also has a built-in option to give audio feedback when a key is pressed. This is an accessibility setting where the name of the key that you tap is announced. If you’d rather just have keyboard typing sounds like those you get on iOS, you can use a free app called JazzUp.

Keyboard typing sounds

Download and run JazzUp. It doesn’t take any set up at all. It will add a music note icon to the menu bar to indicate it’s running and you will immediately start getting audio feedback for any and all keys that you tap.

How to enable key repeating in macos

If you click the app’s menu bar icon, you will get a menu of sounds that you can select from. It has typewriter sounds, and the iOS key tap sound that you get when you type on an iPhone or iPad. The app has a modest set of sounds but it still includes a ‘Spoken’ option where the key that you type is spoken out loud. It’s redundant on macOS since that particular option is built-in but the other sounds are not.

How to enable key repeating in macos

A lot of people keep typing sounds turned off on their iOS devices but they might help you be more productive, or you might just like the novelty of the idea on a desktop.

JazzUp is pretty good; there is no delay between the keypress and the audio feedback for it. The sound effect feels native. The app itself is a bit old and it doesn’t have any customization options where you can disable the audio feedback for certain keys e.g., modifier keys. To be fair, the audio sounds are technically supposed to play for all keys. That’s how it works on touch devices so it’s not really a problem with the app, but a limitation that doesn’t take into account that it’s going to be used on a desktop.

You’re limited to using the sounds that JazzUp has i.e., you cannot use a custom sound of your own choice but again, it offers typewriter sounds, both mechanical and electric as well as a few others so it should tie you over nicely.

If you’d like something similar on Windows 10, we’ve covered an app that lets you add typing sounds for a physical keyboard to a Windows 10 PC.

On a Windows machine, pressing and holding a keyboard key results in the character being repeated. For example, if I press and hold q for a few seconds, I end up with the following:

Similarly, I can press and hold the Backspace key to delete multiple characters.

On a Mac pressing and holding a key for several seconds results in the character being typed only once. To type it repeatedly, it is necessary to physically press it multiple times.

I’m unclear about whether that is a bug or a supposed-feature, but I am interested in replicating this functionality on a Mac.

A couple of notes and additional ideas to supplement the selected answer:

The speed of repetition of characters (how many characters are added per second when a key is held down) can be controlled by adjusting the “Key Repeat” option under System Preferences => Keyboard (Keyboard tab). However, if the fastest speed is not fast enough (it wasn’t for me), you can further adjust this setting by opening Terminal and typing:

Where 0 indicates the minimum speed (smaller is faster). The fastest that can be set by the system preferences is 2 , so the other two remaning, faster options are 1 (fast) and 0 (fastest).

The amount of time it takes for key repetition to begin can also be set by adjusting the “Delay Until Repeat” option under System Preferences => Keyboard (Keyboard tab). Again, if this is still too slow for you (as it was for me), you can set an even faster speed by opening Terminal and typing:

Where 4 , again, can be adjusted (smaller is faster). I’d highly recommend you do not set this option under 4 , though, because that would just be impossibly fast (touching a key for a mere split second would type about 10 repeating characters). I ended up setting mine to 7 , which might still be too fast for me.

macOS provides audio feedback for lots of things e.g., when you move files to the trash, when you take a screenshot, or when you connect the power adapter to a MacBook. It also has a built-in option to give audio feedback when a key is pressed. This is an accessibility setting where the name of the key that you tap is announced. If you’d rather just have keyboard typing sounds like those you get on iOS, you can use a free app called JazzUp.

Keyboard typing sounds

Download and run JazzUp. It doesn’t take any set up at all. It will add a music note icon to the menu bar to indicate it’s running and you will immediately start getting audio feedback for any and all keys that you tap.

How to enable key repeating in macos

If you click the app’s menu bar icon, you will get a menu of sounds that you can select from. It has typewriter sounds, and the iOS key tap sound that you get when you type on an iPhone or iPad. The app has a modest set of sounds but it still includes a ‘Spoken’ option where the key that you type is spoken out loud. It’s redundant on macOS since that particular option is built-in but the other sounds are not.

How to enable key repeating in macos

A lot of people keep typing sounds turned off on their iOS devices but they might help you be more productive, or you might just like the novelty of the idea on a desktop.

JazzUp is pretty good; there is no delay between the keypress and the audio feedback for it. The sound effect feels native. The app itself is a bit old and it doesn’t have any customization options where you can disable the audio feedback for certain keys e.g., modifier keys. To be fair, the audio sounds are technically supposed to play for all keys. That’s how it works on touch devices so it’s not really a problem with the app, but a limitation that doesn’t take into account that it’s going to be used on a desktop.

You’re limited to using the sounds that JazzUp has i.e., you cannot use a custom sound of your own choice but again, it offers typewriter sounds, both mechanical and electric as well as a few others so it should tie you over nicely.

If you’d like something similar on Windows 10, we’ve covered an app that lets you add typing sounds for a physical keyboard to a Windows 10 PC.