---
description: >-
  Presented via IInputManager interface, this small but useful system provides
  you with information about player inputs.
---

# Input Manager

To use this system, inject IInputManager interface into your class, as shown below:

```csharp
[Inject] private IInputManager inputManager;
```

### Available methods

```csharp
Vector3 GetMovementDirection()
```

_This method returns normalized movement direction (in screen space). For example, if player is pushing W button on keyboard, this method returns (0, 0, 1)._

_Example:_

```csharp
Vector3 movementDir = inputManager.GetMovementDirection();

characterController.Move(moveSpeed * Time.deltaTime * cameraController.GetWorldDirection(movementDir));
```

{% hint style="info" %}
As you can see in example, you can convert screen space movement direction into world space direction via GetWorldDirection method of CameraController class.
{% endhint %}

***

```csharp
void AddKeyListener(KeyCode key, UnityAction keyDownCallback, UnityAction keyUpCallback)
```

_Registers key listener, its key down and key up callbacks._

_Example:_

```csharp
inputManager.AddKeyListener(KeyCode.Space, Jump, null);
```

***

```csharp
void RemoveKeyListener(KeyCode key, UnityAction keyDownCallback, UnityAction keyUpCallback)
```

_Removes key listener_
