Click mouse and release in the usual area of the keys, as indicated on middle C and A440. Only the middle octave is implemented but the rest are easily added
I strongly recommend Audacity for checking /editing /playing any WAV files you produce.
The tones are pre-calculated with the other program- in the example supplied they are exponentially decaying sine tones. Code is availabel as PianoKBD.zip