Categories
Computers English Mac WTF

Forcing macOS to use ISO Keyboard Type

Learn how to force a keyboard type of ISO on your Mac

I just acquired a new keyboard, a CHERRY MX 8.2 TKL Wireless, for use with several different machines (as I use it connected to a USB switch, that is used by 4 different machines), and macOS was acting up again. The “less than” (<) and “greater than” (>) keys were at the wrong place, as was the “caret” (^) key. They had exchanged their positions, so to speak.

It turned out that this was due to the fact that the “keyboard type” was set to “ANSI,” instead of “ISO.” In theory, this should be easy to configure in macOS’ “System Settings”, however, this didn’t work for me. Many people have this issue as I found out, and sometimes there doesn’t seem to be a straight-forward solution, so I decided to wrap up these quick instructions how to force your Mac to use ISO.

The settings are contained in /Library/Preferences/com.apple.keyboardtype.plist, and you can display them as follows:

% defaults read /Library/Preferences/com.apple.keyboardtype.plist
{
    keyboardtype = {
    "1031-4176-0" = 41;
    "176-1130-0" = 41;
    "229-1130-0" = 40;
    "232-1671-0" = 41;
    "2324-10429-0" = 41;
    "236-1130-0" = 40;
    "50475-1133-0" = 41;
    };
}

This shows various keyboards that were or still are connected to my Mac, and their keyboard types. 40 is ANSI, while 41 is ISO.

Do not try to cat the file or edit it with a text editor, as it’s a binary file that can’t be easily displayed or edited without converting it into XML format. To do so, run the following command:

% sudo plutil -convert xml1 /Library/Preferences/com.apple.keyboardtype.plist

You can then edit the file with your favourite text editor as an XML file:

% sudo vim /Library/Preferences/com.apple.keyboardtype.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
        <key>keyboardtype</key>
        <dict>
                <key>1031-4176-0</key>
                <integer>41</integer>
                <key>176-1130-0</key>
                <integer>41</integer>
                <key>229-1130-0</key>
                <integer>41</integer>
                <key>232-1671-0</key>
                <integer>41</integer>
                <key>2324-10429-0</key>
                <integer>41</integer>
                <key>236-1130-0</key>
                <integer>41</integer>
                <key>50475-1133-0</key>
                <integer>41</integer>
        </dict>
</dict>
</plist>

I changed all keyboards to ISO format, and even without converting the file back to its binary format, the changes were immediately applied after saving the file, and my keyboard finally behaved properly.

For the sake of completeness, here’s how you would convert the file back to its binary format:

% sudo plutil -convert binary1 /Library/Preferences/com.apple.keyboardtype.plist

I hope this helps. Let me know your experience, please. Many thanks.

By Ralf Bergs

Geek, computer guy, licensed and certified electrical and computer engineer, husband, best daddy.

6 replies on “Forcing macOS to use ISO Keyboard Type”

Dude this absolutely worked for me, can’t thank you enough. The extra problem I was having was that, while my *mouse* was in the plist file, my keyboard wasn’t appearing there at all (perhaps because it’s one I built myself running custom QMK firmware). I found the product ID and vendor ID using ioreg -l and added tags for it and rebooted and it worked.

Hi Dan, I’m really glad to hear this helped. Thanks for leaving feedback and also for the tip about using “ioreg -l” to enumerate the devices.♥️
Cheers!

would it be possible to do that on a MacBook Air purchase for the iso region but I want to use the ansi US layout, I can’t believe these beutiful machines are locked like that, I want to find a way like this hack instead of resorting to 3rd part apps like karabiner or whatever, great post btw chatgpt couldn’t even figure this one out although when I showed it this stuff it quickly figure it out but now I have the issue on my MacBook Air haha

Hi Bryan. I’m not sure I fully understand your problem, could you please elaborate?

Apple doesn’t “lock” any machine to any region or prevents certain settings to be used by the user. If there is any issue like the one I had, it’s simply a bug in macOS. 😉

(BTW, funnily enough I had the same problem later with yet another keyboard, and the above “hack” didn’t work, so I had indeed to resort to using Karabiner.

Kind regards,

Ralf

thanks for the quick reply!

my issue is actually I have MacBook Air from iso region and apple keyboard Russian layout, so it seems these devices are not shown in that file, so there is nothing one can do as of now except for karabiner, basically you can’t with apple gear or internal laptop keyboard change between iso/ansi, however, when it comes to 3rd party keyboards, did you try to trick the keyboard type assistant into thinking you were using the desired keyboard, my problem in particular is that this key ~ super useful for moving around terminal is mapped to the key next to shift instead of tab, I had to resort as well to karabiner, but hopefully someone figures out a hack to avoid using that in the background!
cheers and great post again!

Hi Bryan. Thanks for the followup.

Now I understand.

I can’t explain exactly why it sometimes happens that a specific keyboard doesn’t show up in that file. I’m very sure, though, that it’s not intentional. It simply doesn’t make any sense to “sabotage” users in such way, not even Apple would do so. 😜

I believe it must be a bug. There’s many in macOS, unfortunately, and it gets worse. When I started using macOS (spelled “MacOS” back then) exactly 20 years ago, it was a very trustable OS. Nowadays, there’s a lot of unexplainable and weird behaviors.

One example, because it kind of fits to this case here: I have a cascade of USB devices with several hubs involved: a Thunderbolt 4 dock, then a USB switch (with a USB hub built into it), then it goes to a monitor with USB hub include, and then a mouse and a keyboard. The very same hardware tree works well in Windows 11 on my Lenovo laptop, but the last node (display USB hub) is ignored by macOS, so the attached devices (leaves) are missing in macOS… It just doesn’t make any sense… ☹️

Re. Karabiner: To be honest, in the beginning I didn’t like the idea of using such a tool either, but it just works and is not in the way, so I had almost forgotten about it. 😉

Sorry that I don’t have a better answer for you.

Kind regards,

Ralf

Leave a Reply to bryan delgado Cancel reply

Your email address will not be published. Required fields are marked *