Class KeyboardDevice
Special case of an InputDevice identifying itself as a Keyboard. Defines convenience methods to access the keyboard buttons.
Inherited Members
Namespace: Fusee.Engine.Core
Assembly: Fusee.Engine.Core.dll
Syntax
public class KeyboardDevice : InputDevice
Constructors
KeyboardDevice(IInputDeviceImp)
Initializes a new instance of the KeyboardDevice class.
Declaration
public KeyboardDevice(IInputDeviceImp inpDeviceImp)
Parameters
Type | Name | Description |
---|---|---|
IInputDeviceImp | inpDeviceImp | The platform dependent connector to the underlying physical device. |
Properties
ADAxis
Gets the value at the (calculated) axis controlled with the A and the D key. This is the horizontal component of the four key WASD left-handed game steering paradigm
Declaration
public float ADAxis { get; }
Property Value
Type | Description |
---|---|
System.Single | The axis' value in the range between [-1, 1] |
LeftRightAxis
Gets the value at the (calculated) axis controlled with the Left/Right cursor keys.
Declaration
public float LeftRightAxis { get; }
Property Value
Type | Description |
---|---|
System.Single | The axis' value in the range between [-1, 1] |
UpDownAxis
Gets the value at the (calculated) axis controlled with the Up/Down cursor keys.
Declaration
public float UpDownAxis { get; }
Property Value
Type | Description |
---|---|
System.Single | The axis' value in the range between [-1, 1] |
WSAxis
Gets the value at the (calculated) axis controlled with the A and the D key. This is the vertical component of the four key WASD left-handed game steering paradigm
Declaration
public float WSAxis { get; }
Property Value
Type | Description |
---|---|
System.Single | The axis' value in the range between [-1, 1] |
Methods
GetKey(KeyCodes)
Retrieves the current button state for the specified key.
Declaration
public bool GetKey(KeyCodes key)
Parameters
Type | Name | Description |
---|---|---|
KeyCodes | key | The key to check. |
Returns
Type | Description |
---|---|
System.Boolean | true if the button is pressed; otherwise false. |
IsKeyDown(KeyCodes)
Determines whether the specified key was pressed during the current frame. The result is true only for one single frame even if the key is still pressed in subsequent frames.
Declaration
public bool IsKeyDown(KeyCodes key)
Parameters
Type | Name | Description |
---|---|---|
KeyCodes | key | The key to check. |
Returns
Type | Description |
---|---|
System.Boolean | true if the key was pressed during the current frame, false if the key was not pressed during the current frame - even if the key was not released yet. |
IsKeyUp(KeyCodes)
Determines whether the specified key was released during the current frame. The result is true only for one single frame even if the key is still up in subsequent frames.
Declaration
public bool IsKeyUp(KeyCodes key)
Parameters
Type | Name | Description |
---|---|---|
KeyCodes | key | The key to check. |
Returns
Type | Description |
---|---|
System.Boolean | true if the key was released during the current frame, false if the key was not released during the current frame - even if the key currently is released. |