Homemade button to test how hard it was hit

Hmm I dont know if I used the right word, Just to clarify, it is for a midi "ntoe" - like a piano key, so its not so much force I am interested in, more speed..The faster it is pressed, the louder to play the midi note...?