Macro buttons to interact with games/computer

From my understanding.. there is no way to 'tell' or have this only work for TEAMSPEAK3 (or whatever)..

Think of your mouse or keyboard currently connected to you PC.

If you hit the "A" key on the keyboard... it just spits out the "A" character to the PC (more or less)..

Your mouse/keyboard doesnt know or care about app is currently open or has focus.

It is the same scenario here..