What is a rotating "button" called?
https://en.wikipedia.org/wiki/Rotary_encoder


  A rotary encoder, also called a shaft encoder, is an electro-mechanical device that converts the angular position or motion of a shaft or axle to an analog or digital code.


There are many different varieties and you'll need to further define your requirements to decide which is best for your needs.