Xmodmap can do what you're asking for, as long as you don't mind breaking your CapsLock key.
Xmodmap can distinguish between the left and right shift key, so we can initially remap RightShift to ModeSwitch to get our way:
xmodmap -e "keysym Shift_R = Mode_switch"
The basic syntax for modifying the behavior of a key is
xmodmap -e "keycode KEYCODE = KEYSYMBOL1 KEYSYMBOL1 KEYSYMBOL3 KEYSYMBOL4"
xmodmap -e "keysym KEYSYMBOL = KEYSYMBOL1 KEYSYMBOL1 KEYSYMBOL3 KEYSYMBOL4"
KEYSYMBOL2 gets triggered when pressing the key while pressing Shift.
KEYSYMBOL3 gets triggered when pressing the key while pressing ModeSwitch.
KEYSYMBOL4 gets triggered when pressing the key while pressing Shift + ModeSwitch.
KEYSYMBOL1 gets triggered when pressing the key with none of the above.
- ModeSwitch is AltGr by default (only works on some keyboard layouts).
So much for the theory. In practice, these remappings might behave a little different when modifying a Shift + Letter combination. I can't speak for Kubuntu, but some Unity application will will override the behavior specified by Xmodmap in these cases.
To reconfigure each key to only accept the proper modifier, I found the most robust way to be the following:
To make R accept only RightShift, execute the following command:
xmodmap r r R R
To make L accept only LeftShift, execute the following command:
xmodmap l L l l
To make the remappings permanent, create/edit a shell script in
~/.kde/Autostart/, make it executable and save the corresponding commands in it.
To undo all remappings, simply execute the following command: