Joystick Toolkit - @octave_joystick/button


: joy = button (joy, id)

Get the value of button id on joystick joy.

Inputs

joy - a previously opened joystick object
id - a positive numeric id for the joystick button to use

id an be a vector of IDs to allow retrieving multiple buttons.

Outputs

value - value of the button (0 or 1).

value will be a vector of values when getting multiple buttons.

Examples

Open device 1 and get value of button 1

 
 joy = vrjoystick(1);
 val = button(joy, 1)
 
 

See also: vrjoystick.