Main Content

button

Read status of joystick

Syntax

b = button(joy,n)

Description

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