> 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.server/ks.reactor.server.ksvirtualinput.md).

# Class ksVirtualInput

Namespace: [KS.Reactor.Server](/reactor/api-reference/ks.reactor.server.md)\
Assembly: KSReactor.dll

Input manager for virutal players. Input updates are stored and applied once per update cycle during input processing.

```csharp
public class ksVirtualInput
```

#### Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) ← [ksVirtualInput](/reactor/api-reference/ks.reactor.server/ks.reactor.server.ksvirtualinput.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)

## Constructors

### ksVirtualInput(ksInput) <a href="#ks_reactor_server_ksvirtualinput__ctor_ks_reactor_ksinput" id="ks_reactor_server_ksvirtualinput__ctor_ks_reactor_ksinput"></a>

Constructor

```csharp
public ksVirtualInput(ksInput input)
```

#### Parameters

`input` ksInput

## Methods

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

Get an axis value. Returns the last axis value set, or the current input value if no axis value has been set since the last time inputs were processed.

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

#### Parameters

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

axis id

#### Returns

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

axis value

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

Get a value. Returns the last value set, or the current input value if no value has been set since the last time inputs were processed.

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

#### Parameters

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

Value id

#### Returns

ksMultiType

Value

### IsDown(uint) <a href="#ks_reactor_server_ksvirtualinput_isdown_system_uint32" id="ks_reactor_server_ksvirtualinput_isdown_system_uint32"></a>

Check if a button is down.

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

#### Parameters

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

button id

#### Returns

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

true if the button is down

### IsPressed(uint) <a href="#ks_reactor_server_ksvirtualinput_ispressed_system_uint32" id="ks_reactor_server_ksvirtualinput_ispressed_system_uint32"></a>

Check if a button was pressed.

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

#### Parameters

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

button id

#### Returns

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

true if the button was pressed since the last processing

### IsReleased(uint) <a href="#ks_reactor_server_ksvirtualinput_isreleased_system_uint32" id="ks_reactor_server_ksvirtualinput_isreleased_system_uint32"></a>

Check if a button was released.

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

#### Parameters

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

button id

#### Returns

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

true if the button was released since the last processing

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

Set the value for an axis

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

#### Parameters

`axisId` [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_server_ksvirtualinput_setbutton_system_uint32_system_boolean" id="ks_reactor_server_ksvirtualinput_setbutton_system_uint32_system_boolean"></a>

Set the state of a button

```csharp
public void SetButton(uint buttonId, bool isDown)
```

#### Parameters

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

button id

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

is the button held down?

### SetValue(uint, ksMultiType) <a href="#ks_reactor_server_ksvirtualinput_setvalue_system_uint32_ks_reactor_ksmultitype" id="ks_reactor_server_ksvirtualinput_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

Value to set.
