Main Content

button

R2026b

(Removed) Read status of joystick

button has been removed. For more information, see Version History.

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

expand all