The width of all keys, white or black, should be equal to one another at the back of the keyboard.
The width of the white keys should be exactly equal to one another at the front of the keyboard.
Those can't both be true (since 5/12 isn't equal to 3/7), so the former has to be fudged a bit.
My formula is in a different comment. :)
The black and white keys are instantly recognisable as a piano, but need a bit more inspection to notice the error.
The placement so that the two groups of black keys, C#-D# and F#-G#-A#, are a little bit wider than the naive on-center placement, as if they were repelled from each other.
The thin parts of the white keys that are between the black keys are evenly spaced with the black keys: i.e. all 12 semitones are equally spaced at the back. The rear ends of the keys directly link to the striking mechanism, which lines up with evenly-spaced string courses.