Attaching Sound to Keypress

Oh yea, and could you explain it? Because I read an earlier post with similar question, but have no clue how to apply it to my problem. Thx.