I have a really strange problem with my sister's MacBook Pro (Mid 2012, running El Capitan): it is incorrectly identifying the physical layout of the built-in keyboard. It isn't just a matter of mapping the buttons to characters incorrectly; the diagram shown in "Keyboard Viewer" actually shows more physical buttons than exist on the keyboard.
Note: see the update at the end for the current status.
The physical keyboard appears to be the correct US English version, and it is called "U.S." in the "Input Sources" preferences pane — but here's a screenshot of what Keyboard Viewer thinks it physically looks like:
The problems become more obvious with Shift pressed:
Thanks to Wikipedia-ing (and a helpful clue from the yen symbol), I think this is showing the Japanese Industrial Standard layout, but I don't actually read any East Asian alphabets, so I'm less than 100% confident.
My goal is to get the layout recognized as standard US QWERTY, either (preferably) by actually getting OS X to believe it is one, or by re-mapping the keys it believes it has. I've read Create and use your own input source, but so far without success. I think my issue may be that the characters it wants to map from are the Japanese(?) ones rather than the ASCII ones.
Interestingly, I tried booting from a Ubuntu USB, and it recognized the keyboard with no problems. On the other hand, the layout was still incorrect when I booted from the OS X recovery partition.
Any advice on how to correct this would be very greatly appreciated!
Inspired by Tom Gewecke's answer below, I tried re-setting the SMC, which has changed things. Probably the fastest way to describe it is with two new screenshots (taken with the "U.S." input source):
As you can see, it's not Japanese anymore, but it also still doesn't match the layout of the physical keyboard. In Keyboard Viewer:
- The diagram shows a key with
±to the left of the
!key. but the actual keyboard has a key marked
~. When I press this key, Keyboard Viewer shows it as a press to the
~key between the
shiftkeys (there is no physical key between
- The diagram shows a vertical
enterkey and an extra
|key at the right-hand side of the home row, between
enter. The actual keyboard has a horizontal
enteron the home row and has the
|key as the last key on the QWERTY row, to the right of
}. Again, Keyboard Viewer shows a press of the physical
|as a press of its misplaced key.
So, for practical purposes, this is a huge improvement, since the physical keys now all do what their keycaps say they do. On the other hand, something is clearly still wrong, since Keyboard viewer still has keys in the wrong place, keys that are the wrong shape, and one key in it's diagram (the
± key) that isn't mapped to any to any physical key on the keyboard.
I've tried resetting the SMC a number of times; the resulting layout is always either JIS or ISO, but never ANSI, and I've yet to find any pattern that would allow me to predict which the result will be. More concerningly, even when I get an ISO layout by resetting the SMC, it will revert to a JIS layout at some arbitrary point while using the system.