Code to self-configure input devices