User`s guide

10 Functions — Alphabetical List
10-74
vrjoystick
Create joystick object
Syntax
joy = vrjoystick(id)
joy = vrjoystick(id,'forcefeedback')
Description
joy = vrjoystick(id) creates a joystick object capable of interfacing with a joystick
device. The id parameter is a one-based joystick ID.
joy = vrjoystick(id,'forcefeedback') enables force feedback if the joystick
supports this capability.
Methods
Method Description
axis a = axis(joy, n) reads the status of joystick with
axis number n. Axis status is returned in the range
of -1 to 1. The n parameter may be a vector to return
multiple buttons.
button b = button(joy, n) reads the status of joystick
button number n. Button status is returned as
logical 0 if not pressed and logical 1 if pressed. The
n parameter may be a vector to return multiple
buttons.
caps c = caps(joy) returns joystick capabilities, such
as the number of axes, buttons, POVs, and force-
feedback axes. The return value is a structure with
fields named Axes, Buttons, POVs, and Forces.