Class Keyboard
Represents a single hardware keyboard device. Used by the Input to report raw keyboard input events.
Inherited Members
Assembly: FlaxEngine.dll
File: Engine/Input/Keyboard.h
Syntax
public class Keyboard : public InputDevice
Constructors
Keyboard()
Declaration
protected Keyboard()
Fields
_prevState
_state
Methods
GetInputText()
Gets the text entered during the current frame (Unicode format).
Declaration
public StringView GetInputText() const
Returns
StringView
|
GetKey(KeyboardKeys key)
Gets keyboard key state.
Declaration
public bool GetKey(KeyboardKeys key) const
Parameters
KeyboardKeys
key
Key ID to check. |
Returns
bool
True if user holds down the key identified by id, otherwise false. |
GetKeyDown(KeyboardKeys key)
Gets keyboard key down state.
Declaration
public bool GetKeyDown(KeyboardKeys key) const
Parameters
KeyboardKeys
key
Key ID to check |
Returns
bool
True if user starts pressing down the key, otherwise false. |
GetKeyUp(KeyboardKeys key)
Gets keyboard key up state.
Declaration
public bool GetKeyUp(KeyboardKeys key) const
Parameters
KeyboardKeys
key
Key ID to check |
Returns
bool
True if user releases the key, otherwise false. |
IsAnyKeyDown()
Checks if any keyboard key is currently pressed.
Declaration
public bool IsAnyKeyDown() const
Returns
bool
|
OnCharInput(Char c, Window* target=nullptr)
Called when keyboard enters input character.
Declaration
public void OnCharInput(Char c, Window* target=nullptr)
Parameters
Char
c
The Unicode character entered by the user. |
Window
target
The target window to receive this event, otherwise input system will pick the window automatically. |
OnKeyDown(KeyboardKeys key, Window* target=nullptr)
Called when key goes down.
Declaration
public void OnKeyDown(KeyboardKeys key, Window* target=nullptr)
Parameters
KeyboardKeys
key
The keyboard key. |
Window
target
The target window to receive this event, otherwise input system will pick the window automatically. |
OnKeyUp(KeyboardKeys key, Window* target=nullptr)
Called when key goes up.
Declaration
public void OnKeyUp(KeyboardKeys key, Window* target=nullptr)
Parameters
KeyboardKeys
key
The keyboard key. |
Window
target
The target window to receive this event, otherwise input system will pick the window automatically. |
ResetState()
Resets the input device state. Called when application looses focus.
Declaration
public virtual void ResetState() override
Overrides
Update(EventQueue& queue)
Captures the input since the last call and triggers the input events.
Declaration
public virtual bool Update(EventQueue& queue) final override
Parameters
EventQueue
queue
The input events queue. |
Returns
bool
True if device has been disconnected, otherwise false. |