How to reset the Mac keyboard

mac_keyboard_detectionMacs, known for their elegant design, often require knowing different ways to do such things as changing your browser, learning where your folders are, or even changing your inkjet cartridges.   Here is the easiest way to reset your keyboard. The screenshot you see here on the left shows a Mac OS X (Leopard) window that pops up when a new usb keyboard is connected. It asks user to press the key on the right of (left) shift, to detect the correct international map. Yesterday I had a problem with the keyboard of a Mac Mini I have in my office network: “<>” and “\” keys were swapped.

In the italian keyboard, “<>” is the key on the right of left-shift, and “\” (the backslash) is above the TAB key.

Apparently without any valid reason, these keys reversed their position, like (I think) they are on official Apple keyboards (I use instead a normal Toshiba PC keyboard). I tried to disconnect and reconnect the USB plug, but the selection window didn’t appear – I think because the system “remembers” that keyboard, so it doesn’t think it’s necessary to ask user to press keys to detect it again.

After a lot of Googling, I found that it’s necessary to delete a file to make Mac OS completely forget keyboard settings:
/Library/Preferences/com.apple.keyboardtype.plist

So, after the deletion of this file, I reconnected the keyboard and I completed the dection wizard. Keys are now fixed :)

This entry was posted in Mac, Tricks and tagged , . Bookmark the permalink. Trackbacks are closed, but you can post a comment.

23 Comments

  1. Posted November 18, 2009 at 11:35 pm | Permalink

    Thanks for that. Somehow I managed to screw up my keyboard settings tonight, and this fixed it. :)

  2. Posted May 11, 2010 at 8:47 am | Permalink

    Thank you very much. I googled for it for hours :)

  3. Posted May 27, 2010 at 6:01 pm | Permalink

    Mille grazie
    Merci!
    Danke!

  4. Posted November 5, 2010 at 3:13 am | Permalink

    Thanks. I lost half a day trying to figure this out, and would have been another whole day i think before getting to this solution :)

    PD: had the º and < keys swapped, on a Spanish ISO keyboard.

  5. Christian
    Posted February 7, 2011 at 11:56 am | Permalink

    Thank you, had the same problem with a german layout pc-keyboard.

  6. HARRY
    Posted February 23, 2011 at 7:38 pm | Permalink

    I CANT EVEN DELETE IT KEYBOARD IS STUCK IN CAPS LOCKS AND WHEN I TYPE NUMBERS THIS COMES UP > !@£$%^&*()_+

    IF ANYONE CAN HELP I CANT DELETE IT BECAUSE I NEED TO ENTER MY PASSWORD AND MY PASSWORD IS LOWER CAPS

  7. StoneC
    Posted March 22, 2011 at 1:40 pm | Permalink

    Thanks, one hour googled an this fixed it

  8. Posted April 22, 2011 at 9:24 pm | Permalink

    Thank you so very much.. I’ve spent a couple of days trying to find the correct thing to look for, I couldn’t find anything useful. A helpful guy told me to check out Ukulele but my mind couldn’t focus on it, then I decided to try and look for “osx reset iso usb keyboard” and found your site, and now I have the correct ones. Thank you so much!!!!! This is a real lifesaver, pressing from the laptop keyboard whilst typing stuff on the external USB Keyboard was really doing my head in :)

  9. Alex
    Posted October 5, 2011 at 12:57 am | Permalink

    how do i delete this file? copying the link into my browser only brings up text edit

  10. Nico Andrade
    Posted November 2, 2011 at 9:19 pm | Permalink

    You save my day men!! I had this problem with my Spanish Keyboard

    Thank you!

  11. Anonymous
    Posted March 29, 2012 at 12:42 am | Permalink

    omg thank you for this :)

  12. Lucas
    Posted May 28, 2012 at 10:36 am | Permalink

    For everyone trying to delete this file:
    Open the application “Terminal” and type this:

    sudo rm /Library/Preferences/com.apple.keyboardtype.plist

    Then you have to type your user password (doesn’t work when you don’t have one).

    Another way is to use Finder’s SHIFT+CMD+G to go to the location /Library/Preferences and then deleting the file as usual.

  13. TesterMac
    Posted May 28, 2012 at 11:40 pm | Permalink

    Thx

    I search about 45mins on google until i found your blog…

  14. TriSh
    Posted December 21, 2012 at 5:07 am | Permalink

    I have been Struggling for awhile and when I went to library, then preferenceS, and then the file com.apple.keyboardtype.pliSt doe not exiSt on my harddrive. HELP.

  15. Ben
    Posted December 21, 2012 at 8:54 am | Permalink

    Trish,
    I suspect that if u follow Lucas’s directions above, you will indeed delete the file. Keep in mind that when you select Terminal, you are leaving nicely-designed world of Mac and temporarily entering a dark and mystical world. So, when you type (or cut-paste) Lucas’s suggested command, you will not get a nice confirmation that the file was indeed deleted. However, if you run the command again, and the file was really deleted, it will say “file not found”, which means it’s gone. Yay! One more thing, when you type your password as directed, you don’t see anything. Just type it and press Enter (Return). Hope this helps…

  16. Posted May 6, 2013 at 3:27 am | Permalink

    It is not letting e enter any nu,bers and ,y passzord has nu,bers; any suggestions

  17. de
    Posted October 19, 2013 at 12:56 pm | Permalink

    any idea on where to find this file on 10.8 ? thanks

  18. Raine
    Posted February 17, 2014 at 11:47 am | Permalink

    @de, For me on 10.8.5 it was where described in the article.

    I had to also restart the computer to make it prompt about the keyboard.

  19. Posted June 2, 2014 at 5:23 pm | Permalink

    Another thanks from my side; it solved the problem that I had a dead caret on my “” key (intl./German keyboard), instead of the mod4 which KeyRemap4MacBook should’ve put there for my Neo configuration.

    I once went through Apple’s “recognize keyboard” dialog, which obviously caused the problem, and removing the file let OS X forget the settings.

  20. Posted June 9, 2014 at 1:24 am | Permalink

    I also couldn’t find the file in the preference map And I tried to find it with terminal as suggested above. But when I do I get the following message:

    rm: /Library/Preferences/com.apple.keyboardtype.plist: No such file or directory

    Also, I didn’t run the command again so i quess that’s the end for my keyboard then… haha

    No srsly does anyone have a clue what to do?
    you would be of great help!

  21. Pottkopp
    Posted October 18, 2014 at 12:56 pm | Permalink

    Thanks a lot man!! Worked just fine for me :) Had the problem for months now with the swapped keys…

  22. Angel
    Posted November 25, 2014 at 2:49 pm | Permalink

    Thank you very much, I’m from Spain and was having problems with my brand new mechanical keyboard. Now it’s solved.

    Thanks again!!!

    Angel.

  23. JohnyGeld
    Posted December 8, 2014 at 6:58 pm | Permalink

    after a lot of searching this did the trick, just deleting the keyboard file makes is all work.

    Thanks!

Post a Comment

Your email is never published nor shared.

You may use these HTML tags and attributes <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>