Why a "keyboard"

Can anyone explain how the word “key” got associated with the buttons that you press on a calculator, typewriter, or keyboard?

I learned to type on an old Underwood manual typewriter and the keys were shaped a little like a keystone, so that’s one guess. My other guess is that the “key” (as in the key to a map) is printed on the button.

Just curious.

It would be more correct to ask why did a piano’s playing surface get called a keyboard. It had the name long before the typewriter.

Thanks for the lead. I found the answer here:
http://www.britannica.com/bcom/eb/article/2/0,5716,108412+2,00.html

The keys started on organs, moved to other keyboard instruments, then to early typewriters, which I believe had an arrangement more like a piano than the typewriters we know.