It looks to me like a very standard mechanical rotary encoder with integral pushbutton. The 2 connections on one side are the pushbutton, the 3 on the other side are the encoder. There are variations in number of detents per revolution and occasionally in number of states per detent (which is most commonly 4), but they are all very similar. I have a library for interfacing to rotary encoders at GitHub - dc42/arduino: Reusable modules, drivers and patches for the Arduino platform.