Show / Hide Table of Contents

Class KeyboardDevice

Special case of an InputDevice identifying itself as a Keyboard. Defines convenience methods to access the keyboard buttons.

Inheritance
System.Object
InputDevice
KeyboardDevice
Inherited Members
InputDevice.NewAxisID
InputDevice.IsConnected
InputDevice.Id
InputDevice.Desc
InputDevice.Category
InputDevice.AxesCount
InputDevice.AxisDesc
InputDevice.GetAxisDescription(Int32)
InputDevice.GetAxis(Int32)
InputDevice.GetAxisRaw(Int32)
InputDevice.SetAxisDeadzone(Int32, Single)
InputDevice.GetAxisDeadzone(Int32)
InputDevice.AxisValueChanged
InputDevice.ButtonCount
InputDevice.ButtonDesc
InputDevice.GetButtonDescription(Int32)
InputDevice.GetButton(Int32)
InputDevice.IsButtonDown(Int32)
InputDevice.IsButtonUp(Int32)
InputDevice.ButtonValueChanged
InputDevice.RegisterCalculatedAxis(AxisDescription, InputDevice.AxisValueCalculator, Single)
InputDevice.RegisterVelocityAxis(Int32, Int32, Int32, String, AxisDirection)
InputDevice.RegisterSingleButtonAxis(Int32, AxisDirection, Single, Single, Int32, String)
InputDevice.RegisterTwoButtonAxis(Int32, Int32, AxisDirection, Single, Single, Int32, String)
InputDevice.PostRender()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
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.

Generated by DocFX
GitHub Repo
Back to top