What code should I use so that when a key is pressed (even if it is pressed in another program) my program can react.

In any examples you give can you just add the key pressed to a string. And then I can easily modefiy it to my needs.

Thanx for any help provided.