Is there an argument for it being a switch? Here’s the (pertinent) definition of switch, as given in the Oxford dictionary.
a device for making and breaking the connection in an electric circuit.
As you can see here clearly laid out, a switch is by definition electrical, so does not apply in the case of a traditional piano. You should think this is the end of it, but here’s the (pertinent) definition for button.
a knob on a piece of electrical or electronic equipment that is pressed to operate it.
So this word is also defined in terms of electrical equipment, leaving us in quite the conundrum.
However, between these two definitions, one is clearly more applicable to a piano key than the other. Ignoring the “electric” portions of each definition, the difference is that a button is pressed to operate a machine, while a switch can turn a machine on and off.
I don’t know if you’ve ever touched a piano, but I have, and I can tell you that you can’t press a key to make the piano stop playing a note. This leads me to the reasonable conclusion that a piano key is closer to a button than a switch, and that the definition is exact for electronic keyboards.
But the definition still doesn’t fit for traditional pianos. Luckily enough, there are more than two words in the English language, so here’s what I believe is the most accurate way to define a piano key.
The word lever, defined below.
a projecting arm or handle that is moved to operate a mechanism.
If you look at the way a piano actually works, pressing on the key causes a hammer within the piano to move and hit the actual strings, making the note. Thus, this definition is perfect for describing the actual function of a piano key.
TL;DR: Buttons and switches are both electrical-based by definition, so don’t apply to a piano. Button is more applicable to piano keys than switch is, because a switch can turn something on and off but a button doesn’t have as rigid a function. The best term to actually use for a piano key is lever, because the keys are moved to operate a mechanism, which is the definition of a lever.