In car stereos for example the volume control often seems to be a rotary switch and the control knob can be turned around for infinity in one direction. But the volume will only reach its maximum value and then stay there. How does this work and can it be achieved in a simple way?
Why doesn't it start over again with low volume? The same thing is for digital cameras that have wheel controls for setting exposure time.
These are generally encoders that have a quadrature output. The software in the embedded controller can read the qudrature output and determine direction of travel. The limits of how far you can adjust the volume is handled by the software in the controller which will prevent you from going higher than 100% or lower than 0%.
This is just a very short explanation of quadrature. If you run a search for tutorials on the topic, you will come up with quite a few.
And here is an example of a 32 position rotary encoder that also has a push button. An example of the push button setup would be a stereo where the volume control can also be pushed to turn it on or off.
Remember this is only one model of rotary encoder. There are lots of different brands with varying capabilities including some that have over 2000 steps per revolution.