# User Input

Listening to user input is done through various input classes. Below are a few high-level examples of using these input classes.

For more complete documentation, please look through the other input documentation pages in this section.

### [Actions](/unity-for-airship/user-input/actions.md)

```typescript
// Define an action
Airship.Input.CreateAction("Jump", Binding.Key(Key.Space));

// Listen to using the action
Airship.Input.OnDown("Jump").Connect(() => {
    print("Jump pressed")
});
```

### [Keyboard](/unity-for-airship/user-input/keyboard.md)

```typescript
// Listening for key down:
Keyboard.OnKeyDown(Key.E, (event) => {
    print("Key E down");
});

// Checking if a key is currently down:
if (Keyboard.IsKeyDown(Key.E)) print("Key E down");
```

### [Mouse](/unity-for-airship/user-input/mouse.md)

```typescript
// Listen for left button down and print out current screen position:
Mouse.onLeftDown.Connect(() => {
const screenPosition = Mouse.position;
    print("Left mouse button down", screenPosition);
});

// Left button up:
Mouse.onLeftUp.Connect(() => {
    print("Left mouse button up");
});

// Mouse moved:
Mouse.onMoved.Connect((screenPosition) => {
    print("Mouse moved", screenPosition);
});
```


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.airship.gg/unity-for-airship/user-input.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
