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 nice write up, as it explains the mechanical as well as electrical design decisions the manufacturer made in the effort to create a device which accurately captures a player’s performance while simultaneously optimizing for cost.