Make joystick button state checks more generic.