Suppose that:
'[' = <alt-gr> <X>
'ù' = <Y>
'%' = <shift> <Y>
'^' = <X>
( <X> and <Y> are scancodes )
I want to swap '[' and 'ù', but '%' and '^' should not change. Thus:
'ù' = <alt-gr> <X>
'[' = <Y>
'%' = <shift> <Y>
'^' = <X>
If I use the next xmodmap script, '[' gets <Y>, but '%' doesn't work anymore:
keycode <Y> = bracketleft
The next xmodmap file solves the problem, where <X>=34 and <Y>=48.
keycode 34 = asciicircum dead_diaeresis bracketleft bracketleft bracketleft bracketleft
keycode 48 = bracketleft percent dead_acute dead_acute dead_acute dead_acute