Sorry Eteocles I am going to have to correct you here.

You can use keymaps, each is loaded for a specific instance of WOW (or whatever program)

I have class specific ones. so all my shammies get a shammy.? keymap and the pala and druid have their own.

basically you map a keystroke to a hotstring e.g.

on instance A keymap you have
CTRL-A -> control-a

on instance B keymap you could have
CTRL-B -> control-a

if you press CTRL-A on A then CTRL-B is pressed on B
and vice versa