Encoder to replace a potentiometer

Thank you both - I have ordered the KY040 .