> For the complete documentation index, see [llms.txt](https://www.opal-rt.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.opal-rt.com/docs/rt-lab/simulink-blocks-reference/rt-lab-library/opjoystick.md).

# OpJoystick

## Description

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-7615b90420a6a96731c12f1da5f9bce3d332934d%2FRTL_opjoystick_block.png?alt=media" alt=""><figcaption></figcaption></figure>

The **OpJoystick** block, located in the **RT-LAB/Miscellaneous** library, allows a user to monitor the movements of a joystick connected to the simulator. The block supports a list of specific joysticks selectable from the mask, and its outputs are created dynamically based on the selected device and its features.

The first option in the Joystick device type parameter is Generic joystick. When selected, it provides a minimal set of information for any joystick connected to the simulator, allowing the actual device to be changed without updating the selection.

Only one joystick per subsystem is supported.

## Mask parameters

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-b5c1f3e4d6bc191c95fc036296bc08089d192bec%2FRTL_opjoystick_mask.png?alt=media" alt="" width="329"><figcaption></figcaption></figure>

<table><thead><tr><th width="217.63641357421875">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><strong>Joystick device type</strong></td><td>List of joystick device types supported by this block.</td></tr><tr><td><strong>Synchronize</strong></td><td>Read joystick values at the beginning of the step.</td></tr></tbody></table>

{% hint style="info" %}
Outputs are created dynamically based on the current selection in the Joystick device type parameter.
{% endhint %}

**When Generic joystick is selected, the block provides:**

* X, Y, and Z axis values
* An array of 4 boolean values corresponding to 4 buttons

## Inputs

This block has no inputs.

## Outputs

<table><thead><tr><th width="295.8182373046875">Output</th><th>Description</th></tr></thead><tbody><tr><td>X</td><td>[-1024, 1023]</td></tr><tr><td>Y</td><td>[-1024, 1023]</td></tr><tr><td>Z</td><td>[-32, 31]</td></tr></tbody></table>

## Characteristics and limitations

<table><thead><tr><th width="294.9090576171875">Characteristic</th><th>Value</th></tr></thead><tbody><tr><td>Direct Feedthrough</td><td>No</td></tr><tr><td>Discrete sample time</td><td>Yes</td></tr><tr><td>XHP support</td><td>No</td></tr><tr><td>Work offline</td><td>Yes</td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://www.opal-rt.com/docs/rt-lab/simulink-blocks-reference/rt-lab-library/opjoystick.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
