The question pretty much says everything. I've seen answers to similar questions, but not this question precisely, and it seems I need a more precise answer. Keep in mind that I am relatively new to programming and won't really understand any high walls of code you put up for me. Please keep it as utterly simple as possible. :(

All I know is that this was very simple (basic?) to do in BASIC, the one language wherein I have some experience.

Remember, I need a specific key pressed, not just any key.

I'm on a Mac, BTW.