I doubt that there's a direct way to do this. Keyboard input is usually directed to whatever program has focus. Otherwise you'd be stealing input from the program that does have focus. You might be able to hook into the input to intercept it before the entire keyboard input then let it pass on to the program that needs it but that's rather involved and doesn't involve and of the GDK functionality. It could also be risky if something screwed up in your program and it didn't get passed on.
Lilith, Night Butterfly
I'm not a programmer but I play one in the office