Some hints.... only.
My /etc/keymap that can be or ought to be adapted (US only):
# 1, 2, 4, 8
# Shift, AltGr, Control, Alt
keymaps 0,1,4,8
# Special keys.
keycode 29 = Control
keycode 56 = Alt
#keycode 464 = AltGr
# Default Shift
keycode 51 = comma...