# Chapter 17: User Input Handling

This chapter covers the design and implementation of a system that processes user input to interact with your game.

Our input handler (`InputHandler`) class is responsible for capturing and maintaining the state of the inputs. It handles keyboard and mouse input and even game controller input.

It first initializes an `EventPump` to process events and a game controller if any. It keeps track of the keys that are currently pressed and the mouse state, including position and whether the left button is pressed. It can provide the current state of a key or controller button, the mouse button state and position, and poll events that have occurred.


---

# 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://lados-organization.gitbook.io/goku/chapter-17-user-input-handling.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.
