MacBook Misidentifies Physical Layout of Built-in Keyboard 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 &quot;Keyboard Viewer&quot; 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 &quot;U.S.&quot; in the &quot;Input Sources&quot; 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!

Update 1:
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 &quot;U.S.&quot; input source):

With no keys pressed: 
With Shift pressed: 

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 § and ± to the left of the 1/!
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 z and left shift keys (there is no physical key between z and shift.
The diagram shows a vertical return/enter key and an extra \/| key at the right-hand side of the home row, between '/&quot; and enter. The actual keyboard has a horizontal enter on 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.
Update 2:
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.
Update 3:
After a long delay, I recently gained access to this machine again. Following up on dan's comment, the keyboard is indeed showing the USB &quot;product id&quot; 0x0264, which appears to be the JIS variant for the MacbookPro10,1 (this model). Here's a screenshot:
You machine is mistaking the Keyboard Type.  See if this helps:

http://m10lmac.blogspot.com/2009/12/fixing-keyboard-type-problems.html

If nothing else works, try this Karabiner fix:

Change Mac Keyboard Identifier after keyboard replacement