I’m making a 2-octave piano, and I want to let the user both click the key and be able to press the keys on the keyboard (“tab” through “backslash” and “1” through “delete”).
One question is whether I can tell it to do something when tab and delete are pressed, and how.
My other concern is how to make a global variable. I want to make a variable called “file” and assign it to “PianoC3.wav” in “Default” to make it global. That way, in both Mousepressed and Keypressed, I don’t have to change it twice. However, it says “file is not defined” in “Default” even though that’s where I assigned it with “var file = ‘PianoC3.wav’;”. Is there something wrong with this, or is this another one of those “fill is not defined” things that I posted a while ago?