Here is a great article from Open Music Labs which details the teardown and design of an old school MIDI keyboard. This is a particularly good write up, as it explains the mechanical as well as electrical design decisions the manufacturer made in an effort to create a device which accurately captures a player’s performance while simultaneously optimizing for cost.