It's called a 'rotary encoder' or a 'quadrature encoder', it's a switch, not a potentiometer at all - they have two contacts, and close in sequence - the order they do this in tells you which way you're turning it. The speed of the pulses tells you how fast it's being turned.
As usual, the PICList provides suitable code for them .