You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Apple Xcode: Keyboard autorepeat

Hi,


Holding down any alphanumeric key in Apple Xcode doesn’t autorepeat, unlike in all other macOS applications; how do I turn keyboard autorepeat back on for alphanumeric keys in Apple Xcode? I am running Apple Xcode Version 10.1 (10B61) [the highest-numbered, most-recent version of Xcode compatible with Apple macOS Version 10.13.6 “High Sierra”].


Also, I wanted to post this in the developer community fora but couldn’t find an “Xcode” topic/category. Can someone provide a link to a more appropriate place where I should/could have posted this question?


’preciate it,

Austin

Posted on Aug 6, 2021 5:15 PM

Reply
Question marked as Top-ranking reply

Posted on Aug 12, 2021 8:09 AM

You can globally disable press and hold behaviour for accent marks and special characters, which will allow key repeat for all characters, by using the following command in Terminal:


defaults write -g ApplePressAndHoldEnabled -bool false


A computer restart is required. To return to press and hold behaviour use the following command in Terminal:


defaults write -g ApplePressAndHoldEnabled -bool true


A computer restart is required.


Code completion suggestions while typing in Xcode is a separate function which you can turn on or off by navigating to Xcode > Preferences > Text Editing > Editing > Code completion. If you uncheck "Show completions while typing" you can still use the Escape key to show completion suggestions.


If you don't use press and hold for accent marks and special characters this may work for you. Otherwise, it will be a PITA to switch back and forth.


Tested with Xcode Version 10.1 (10B61) and MacOS High Sierra Version 10.13.6 in Parallels Desktop 17 for Mac Version 17.0.0 (51461).

5 replies
Question marked as Top-ranking reply

Aug 12, 2021 8:09 AM in response to powerpcg5

You can globally disable press and hold behaviour for accent marks and special characters, which will allow key repeat for all characters, by using the following command in Terminal:


defaults write -g ApplePressAndHoldEnabled -bool false


A computer restart is required. To return to press and hold behaviour use the following command in Terminal:


defaults write -g ApplePressAndHoldEnabled -bool true


A computer restart is required.


Code completion suggestions while typing in Xcode is a separate function which you can turn on or off by navigating to Xcode > Preferences > Text Editing > Editing > Code completion. If you uncheck "Show completions while typing" you can still use the Escape key to show completion suggestions.


If you don't use press and hold for accent marks and special characters this may work for you. Otherwise, it will be a PITA to switch back and forth.


Tested with Xcode Version 10.1 (10B61) and MacOS High Sierra Version 10.13.6 in Parallels Desktop 17 for Mac Version 17.0.0 (51461).

Aug 12, 2021 8:58 AM in response to Roote

Thank you!! This solved my problem! However, could you also provide a link to the original macOS documentation where you found this and/or where the above is documented? ’preciate it


Also, that was hella chill of you to take the extra time and effort to emulate and test my original issue in the exact same versions of Xcode and macOS that I reported using in my original post; you are the Best

Aug 12, 2021 12:33 PM in response to powerpcg5

You're welcome. If I remember correctly the press and hold behaviour first appeared in OS X Lion in 2011. I don't recall where I first came across this specific defaults command. If a primary source exists I'm not aware of it. You can view the man page for defaults in Terminal:


man defaults


If you prefer to retain the default press and hold behaviour for all apps except Xcode, you can delete the global setting and disable it for Xcode only. Make sure Xcode isn't running before changing its plist. First delete the global setting in Terminal:


defaults delete -g ApplePressAndHoldEnabled


Then disable it for Xcode:


defaults write com.apple.dt.Xcode ApplePressAndHoldEnabled -bool false


Tested with Xcode Version 10.1 (10B61) and MacOS High Sierra Version 10.13.6 in Parallels Desktop 17 for Mac Version 17.0.0 (51461).

Apple Xcode: Keyboard autorepeat

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.