Class AnyKeyControl
A control that simply checks the entire state it's been assigned for whether there's any non-zero bytes. If there are, the control returns 1.0; otherwise it returns 0.0.
Inherited Members
Namespace: UnityEngine.InputSystem.Controls
Assembly: Unity.InputSystem.dll
Syntax
public class AnyKeyControl : ButtonControl
Remarks
This control is used by anyKey to create a button that is toggled on as long as any of the keys on the keyboard is pressed.
wasPressedThisFrame is true in any frame in which a key goes down, even if other keys are already held. wasReleasedThisFrame is only true in the frame in which the last held key is released. This means that there can be several presses in a row without a release in between.
Constructors
AnyKeyControl()
Default initialization. Sets state size to 1 bit and format to FormatBit.
Declaration
public AnyKeyControl()
See Also
Methods
ReadUnprocessedValueFromState(void*)
Read value from provided statePtr.
Declaration
public override float ReadUnprocessedValueFromState(void* statePtr)
Parameters
| Type | Name | Description |
|---|---|---|
| void* | statePtr | State pointer to read from. |
Returns
| Type | Description |
|---|---|
| float | The controls current value. |
Overrides
Remarks
Read value from provided statePtr without any caching.