Add gamepad detection code.