You should take a look at AutoIT. It's a programming language for windows, which contains functions to set hotkeys and to send keys to an application. So, to switch 'A' to 'B', the code would look something like this:

Code:
HotKeySet("A","aPressed")
HotKeySet("{ESC}","exit")

While True
WEnd

Func aPressed()
Send("B")
EndFunc

Func exit()
Exit
EndFunc
Make sure you look at the help file before you start. AutoIT's homepage is: http://www.autoitscript.com .