> For the complete documentation index, see [llms.txt](https://fast-studios.gitbook.io/input-hub/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://fast-studios.gitbook.io/input-hub/scripting/scripting.md).

# Overview

Use Input Hub from code.

**Input Hub** is built so that most things can be set up in the Editor, with components and windows. Your game still needs to read the input somewhere, though, and for more advanced needs everything is also available from code. This section covers the code side:

* [Reading Input](/input-hub/scripting/reading-input.md): reading actions and axes, the core of everything.
* [Devices and Schemes](/input-hub/scripting/devices-and-schemes.md): which device is in use, the gamepad, vibration, and simulating devices.
* [Maps](/input-hub/scripting/maps.md): turning groups of actions on and off.
* [Touch](/input-hub/scripting/touch.md): on-screen controls from code.
* [Rebinding](/input-hub/scripting/rebinding.md): changing keys and player settings from code, and handling conflicts yourself.
* [Bind Profiles](/input-hub/scripting/bind-profiles.md): profiles, agents and share codes.
* [Player Save](/input-hub/scripting/player-save.md): plugging Input Hub into your own save system.
* [Prompts and Icons](/input-hub/scripting/prompts-and-icons.md): icon styles, animations, and key names in your own texts.
* [Quick Time Events](/input-hub/scripting/quick-time-events.md): starting them, waiting for them and reading the result.
* [Localization](/input-hub/scripting/localization.md): the language of the game.
* [Local Co-op](/input-hub/scripting/local-co-op.md): players, their devices and their input.
* [Input Manager API](/input-hub/scripting/input-manager-api.md): the replacement for Unity's `Input` class.

## Importing the Namespace

In any script where you want to use Input Hub, import the `FastStudios.InputHub` namespace:

```csharp
using FastStudios.InputHub;

public class YourClass : MonoBehaviour
{
    void Update()
    {
        if (InputHub.Down("Jump"))
        {
            // You can now use Input Hub in your code.
        }
    }
}
```

{% hint style="info" %}
All examples in this section assume the `FastStudios.InputHub` namespace has already been imported.
{% endhint %}

## No Setup Needed

`InputHub` is a static class: there is no manager to add to your scenes and nothing to initialize. It works from the very first frame, even in `Awake`, in every scene. Input Hub runs a small hidden object of its own that is created by itself when the game starts.

## Assemblies

Input Hub's code lives in the **FastStudios.InputHub** assembly. If your scripts are in an **Assembly Definition** of your own, add **FastStudios.InputHub** to its references. Scripts without an Assembly Definition see it automatically.

The [Generated Ids](#generated-ids) are different: **HubIds.cs** is written in the folder where new actions are saved (**New Folder**, in the **PROJECT** section of the Input Hub window), and it belongs to whatever assembly that folder is in. To use `HubAction` and `HubAxis` from your own Assembly Definition, set **New Folder** to a folder inside it. Names as text, like `InputHub.Down("Jump")`, work from anywhere.

## Generated Ids

With **Generate Ids** on, **HubIds.cs** holds a name for every action and axis of your project. Use them instead of typing names, and a typo becomes a compile error instead of a silent bug:

```csharp
InputHub.Down(HubAction.Jump);
InputHub.Move(HubAxis.Move);
prompt.Animate(HubAnimation.Point);
```

`HubAnimation` is not generated: it has the icon animations that come with Input Hub, and works from any assembly.

The names follow your Ids. An Id with spaces or symbols becomes a valid C# name, with an underscore where they were. See [Generated Ids](/input-hub/manual/actions-and-axes/input-hub-window.md#generated-ids).
