SAVED BY THE SHELL!
This post has some fairly recent replies and is on the Apple site. I'm hoping many seekers of "Where did my key repeat go?" will find my reply here. The Terminal command works great. But! Being an AppleScript guy I just had to make a no-fuss no-muss easy solution to toggle the setting. You do have to remember your password and be an administrator user though. Using "do shell script" in AppleScript eliminates using Terminal. Copy the following script and paste it into a new Script Editor document. Compile (Cmd K) and save the document as an application in a handy place. You could link it as a Dictation command. Run the app any time you want to switch the key press behavior! BTW you don't have to copy my rant into the Script Editor. As far as I have tested, you only need to restart any app that is open that uses text entry. You don't need to restart you computer. I am using a MacPro Early 2008 and OS 10.10.3 but this should be OK for earlier OS versions.
Good Luck!
-------------------------------------------------------------------------------- ---------------
-- KEY REPEAT OR POP-UP v-A1
-- ++++++++++++++++++++++++++++++++++++++++++++++++++
-- Apple now thinks desktop computers should act like iPhones and tablets.
-- The current default in OS X is only a few characters will repeat.
-- How about programmers, artists, or anybody that uses rows of characters
-- to put separators in an email, etc. ??????
-- APPLE! MAKE IT A KEYBOARD SYS PREFERENCE OR A FUNCTION KEY!!!!!!!
-- ++++++++++++++++++++++++++++++++++++++++++++++++++
tell application "Finder"
activate
set currentState to ""
set DefaultButtonHilight to 0
-- reading the setting does not need a password but needs administrator privileges!
set repeatOrPopState to do shell script "defaults read -g ApplePressAndHoldEnabled with administrator privileges"
set repeatOrPopState to repeatOrPopState as integer
-- display dialog "repeatOrPopState = " & repeatOrPopState buttons {"CANCEL", "OK"} default button 2
if repeatOrPopState = 0 then
set currentState to "KEY REPEAT is the current state."
set DefaultButtonHilight to 2
else
set currentState to "POP-UP MENU is the current state."
set DefaultButtonHilight to 3
end if
set message1 to ""
beep
display dialog "Select KEY REPEAT or POP-UP Key Press Behavior" & return & return & " >>> " & currentState buttons {"CANCEL", "POP-UP", "REPEAT"} default button DefaultButtonHilight
set userChoice to the button returned of the result
if userChoice is "CANCEL" then
error number -128
end if
if userChoice is not "CANCEL" then
-- The password is used to enable changing the setting.
-- Adding "with administrator privileges" is not needed
-- and actually causes the shell script to fail.
beep
display dialog "PLEASE ENTER YOUR PASSWORD" default answer "PASSWORD" buttons {"CANCEL", "ENTER"} default button 2
copy the result as list to {button_pressed, text_returned}
if button_pressed is "CANCEL" then
error number -128
end if
set myPassword to text_returned
if userChoice is "REPEAT" then
do shell script "defaults write -g ApplePressAndHoldEnabled -bool false" password myPassword
set message1 to "KEY REPEAT IS ON"
end if
if userChoice is "POP-UP" then
do shell script "defaults write -g ApplePressAndHoldEnabled -bool true" password myPassword
set message1 to "POP-UP IS ON"
end if
end if
beep 2
display dialog "--+++-- " & message1 & " --+++--" & return & return & "Close any text apps to reset them!" buttons {"DONE"} default button 1 with icon 2
end tell
beep