Main Content


Read status of joystick


b = button(joy,n)


b = button(joy,n) reads the status of joystick button number n.

Input Arguments

expand all

Joystick, specified as a vrjoystick object.

Button number of joystick, specified as a scalar or a vector.

Output Arguments

expand all

Status of joystick button, returned as either 0 or 1. If n is a vector, multiple buttons are returned.

Version History

Introduced in R2007b

See Also