Hall effect sensor
From Wiki
A Hall effect sensor is a electronic component that through variation in magnetic field varies voltage.
Hall effect sensors are used in modern joysticks such as the Saitek X52 and Logitech G940 replacing potentiometers. By using magnetism instead of a sliding contact, hall effect sensors will not wear out through friction induced wear as a potentiometer eventually will.
Links: