> For the complete documentation index, see [llms.txt](https://kinematicsoup.gitbook.io/reactor/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kinematicsoup.gitbook.io/reactor/api-reference/ks.reactor.client.unity/ks.reactor.client.unity.ksinputmanager.md).

# Class ksInputManager

Namespace: [KS.Reactor.Client.Unity](/reactor/api-reference/ks.reactor.client.unity.md)\
Assembly: KSUnity-Source.dll

Unity implementation of [ksIInputManager](/reactor/api-reference/ks.reactor.client/ks.reactor.client.ksiinputmanager.md). Translates Unity inputs to [ksInput](/reactor/api-reference/ks.reactor/ks.reactor.ksinput.md) and integrates it with direct input.

```csharp
public class ksInputManager : ksIInputManager
```

#### Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) â† [ksInputManager](/reactor/api-reference/ks.reactor.client.unity/ks.reactor.client.unity.ksinputmanager.md)

#### Implements

[ksIInputManager](/reactor/api-reference/ks.reactor.client/ks.reactor.client.ksiinputmanager.md)

#### Inherited Members

[object.Equals(object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals\(system-object\)), [object.Equals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals\(system-object-system-object\)), [object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode), [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype), [object.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone), [object.ReferenceEquals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Properties

### Enabled <a href="#ks_reactor_client_unity_ksinputmanager_enabled" id="ks_reactor_client_unity_ksinputmanager_enabled"></a>

If false, all axes will be zero, all buttons will be up, and all values will be the null multitype.

```csharp
public bool Enabled { get; set; }
```

#### Property Value

[bool](https://learn.microsoft.com/dotnet/api/system.boolean)

## Methods

### BindAxis(uint, string) <a href="#ks_reactor_client_unity_ksinputmanager_bindaxis_system_uint32_system_string" id="ks_reactor_client_unity_ksinputmanager_bindaxis_system_uint32_system_string"></a>

Binds an axis ID to a Unity axis.

```csharp
public void BindAxis(uint axis, string name)
```

#### Parameters

`axis` [uint](https://learn.microsoft.com/dotnet/api/system.uint32)

Axis ID

`name` [string](https://learn.microsoft.com/dotnet/api/system.string)

Unity axis name

### BindButton(uint, string, Validator) <a href="#ks_reactor_client_unity_ksinputmanager_bindbutton_system_uint32_system_string_ks_reactor_client_unit" id="ks_reactor_client_unity_ksinputmanager_bindbutton_system_uint32_system_string_ks_reactor_client_unit"></a>

Binds a button ID to a Unity button.

```csharp
public void BindButton(uint button, string name, ksInputManager.Validator validator = null)
```

#### Parameters

`button` [uint](https://learn.microsoft.com/dotnet/api/system.uint32)

Button ID

`name` [string](https://learn.microsoft.com/dotnet/api/system.string)

Unity button name

`validator` [ksInputManager](/reactor/api-reference/ks.reactor.client.unity/ks.reactor.client.unity.ksinputmanager.md).[Validator](/reactor/api-reference/ks.reactor.client.unity/ks.reactor.client.unity.ksinputmanager/ks.reactor.client.unity.ksinputmanager.validator.md)

Input validation handler.

### BindRawAxis(uint, string) <a href="#ks_reactor_client_unity_ksinputmanager_bindrawaxis_system_uint32_system_string" id="ks_reactor_client_unity_ksinputmanager_bindrawaxis_system_uint32_system_string"></a>

Binds an axis ID to a raw Unity axis.

```csharp
public void BindRawAxis(uint axis, string name)
```

#### Parameters

`axis` [uint](https://learn.microsoft.com/dotnet/api/system.uint32)

Axis ID

`name` [string](https://learn.microsoft.com/dotnet/api/system.string)

Unity axis name

### BindValue(uint, ValueGetter) <a href="#ks_reactor_client_unity_ksinputmanager_bindvalue_system_uint32_ks_reactor_client_unity_ksinputmanage" id="ks_reactor_client_unity_ksinputmanager_bindvalue_system_uint32_ks_reactor_client_unity_ksinputmanage"></a>

Binds a value id to a callback to get the input value.

```csharp
public void BindValue(uint valueId, ksInputManager.ValueGetter getter)
```

#### Parameters

`valueId` [uint](https://learn.microsoft.com/dotnet/api/system.uint32)

Id of value to bind.

`getter` [ksInputManager](/reactor/api-reference/ks.reactor.client.unity/ks.reactor.client.unity.ksinputmanager.md).[ValueGetter](/reactor/api-reference/ks.reactor.client.unity/ks.reactor.client.unity.ksinputmanager/ks.reactor.client.unity.ksinputmanager.valuegetter.md)

Callback for getting the value to bind to.

### GetAxis(uint) <a href="#ks_reactor_client_unity_ksinputmanager_getaxis_system_uint32" id="ks_reactor_client_unity_ksinputmanager_getaxis_system_uint32"></a>

Gets an axis value.

```csharp
public float GetAxis(uint axisId)
```

#### Parameters

`axisId` [uint](https://learn.microsoft.com/dotnet/api/system.uint32)

Id of the axis value to get.

#### Returns

[float](https://learn.microsoft.com/dotnet/api/system.single)

Axis value

### GetButton(uint) <a href="#ks_reactor_client_unity_ksinputmanager_getbutton_system_uint32" id="ks_reactor_client_unity_ksinputmanager_getbutton_system_uint32"></a>

Checks if a button is up or down.

```csharp
public bool GetButton(uint buttonId)
```

#### Parameters

`buttonId` [uint](https://learn.microsoft.com/dotnet/api/system.uint32)

Id of button to check.

#### Returns

[bool](https://learn.microsoft.com/dotnet/api/system.boolean)

True if the button is down.

### GetValue(uint) <a href="#ks_reactor_client_unity_ksinputmanager_getvalue_system_uint32" id="ks_reactor_client_unity_ksinputmanager_getvalue_system_uint32"></a>

Gets a value.

```csharp
public ksMultiType GetValue(uint valueId)
```

#### Parameters

`valueId` [uint](https://learn.microsoft.com/dotnet/api/system.uint32)

Id of value to get.

#### Returns

[ksMultiType](/reactor/api-reference/ks.reactor/ks.reactor.ksmultitype.md)

Value

### SetAxis(uint, float) <a href="#ks_reactor_client_unity_ksinputmanager_setaxis_system_uint32_system_single" id="ks_reactor_client_unity_ksinputmanager_setaxis_system_uint32_system_single"></a>

Sets an axis value.

```csharp
public void SetAxis(uint axis, float value)
```

#### Parameters

`axis` [uint](https://learn.microsoft.com/dotnet/api/system.uint32)

Axis ID

`value` [float](https://learn.microsoft.com/dotnet/api/system.single)

Axis value

### SetButton(uint, bool) <a href="#ks_reactor_client_unity_ksinputmanager_setbutton_system_uint32_system_boolean" id="ks_reactor_client_unity_ksinputmanager_setbutton_system_uint32_system_boolean"></a>

Sets a button down state.

```csharp
public void SetButton(uint button, bool down)
```

#### Parameters

`button` [uint](https://learn.microsoft.com/dotnet/api/system.uint32)

Button ID

`down` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

True if the button is down.

### SetValue(uint, ksMultiType) <a href="#ks_reactor_client_unity_ksinputmanager_setvalue_system_uint32_ks_reactor_ksmultitype" id="ks_reactor_client_unity_ksinputmanager_setvalue_system_uint32_ks_reactor_ksmultitype"></a>

Sets a value.

```csharp
public void SetValue(uint valueId, ksMultiType value)
```

#### Parameters

`valueId` [uint](https://learn.microsoft.com/dotnet/api/system.uint32)

Id of value to set.

`value` [ksMultiType](/reactor/api-reference/ks.reactor/ks.reactor.ksmultitype.md)

Value to set.
