Sufficiently advanced window managers (including Sawfish, Awesome, Fvwm, …) let you define per-window key bindings. Primitive window managers such as Metacity and Mutter (the Gnome defaults) don't. If you want to configure your window environment to do what you want rather than stick to some basic defaults, I recommend using a more advanced window manager. You can still use Gnome with many window managers including Sawfish and Fvwm.
If you want to set up key bindings independently of the window manager, you can use a program just for that, such as xbindkeys. Make your key binding invoke a shell script that acts differently based on the active window. You can use xdotool to retrieve the active window ID (also its title) and then other tools such as xprop to obtain more information about the window.
#!/bin/sh wid="$(xdotool getactivewindow)" class="$(xprop -id "$wid" '$1' WM_CLASS)"; class="${class#*\"}"; class="${class%\"}" case "$class" in Myapp) do something;; *) do something else;; esac