On the white keys, press only the letter. On the black keys, press somewhat near the middle of the key. (Sorry about the random "t"!)
(Sorry about the random "t"!) I saw a random project (Somewhat like this) somewhere, and it inspired me to do a piano! Enjoy! Good luck coding, you guys!