I would like to write a simple C program that will perform different actions based on both \"key down\" and \"key up\" events. This program will be run from inside rxvt.
The following links may be of some assistance in using the keyboard raw mode which will give you access to the keyboard events rather than just key releases.
Raw mode does have the disadvantage that you have to do your own conversion from scan codes to characters though.