Reads joystick data only if gamepadIndex is defined.