From the code:
Try to use the keysym on the first level (lower-case). In case
this doesn’t make it ambiguous (think of a keyboard layout
having '1' on two different keys, but '!' only on keycode 10),
we’ll stick with the keysym of the first level.
This reduces a lot of confusion for users who switch keyboard
layouts from qwerty to qwertz or other slight variations of
qwerty (yes, that happens quite often).