I'd like to find/write a program that can intercept all characters entered at a keyboard and map Dvorak to QWERTY if a control character is depressed. I would normally type in Dvorak, but as soon as I typed in a control character such as CTRL or ALT my input would switch to Dvorak. For example CTRL-D would become CTRL-E.
The operating system would be Debian. I don't know where to start (maybe xmodmap?) so any ideas are appreciated.