yotop456 0 Newbie Poster

I am currently working on a progam that called virtual drumset that will allow a user to play drums with there keyboard. My question is what code could i use to process keyboard input.
For example:

If ( letter g is pressed) then
play sound whatever
end if

Much thanks