Search Results for

    Show / Hide Table of Contents

    Class Keyboard

    Represents a single hardware keyboard device. Used by the Input to report raw keyboard input events.

    Inheritance
    Object
    ScriptingObject
    InputDevice
    Keyboard
    Inherited Members
    ScriptingObject::_gcHandle
    ScriptingObject::_id
    InputDevice::_name
    InputDevice::_queue
    ScriptingObject::_type
    ScriptingObject::CanCast(const ScriptingTypeHandle& from, const ScriptingTypeHandle& to)
    ScriptingObject::CanCast(const MClass* from, const MClass* to)
    ScriptingObject::Cast(ScriptingObject* obj)
    ScriptingObject::ChangeID(const Guid& newId)
    ScriptingObject::CreateManaged()
    ScriptingObject::CreateManagedInternal()
    ScriptingObject::Deleted
    Object::DeleteObject(float timeToLive = 0.0f, bool useGameTime=false)
    Object::DeleteObjectNow()
    ScriptingObject::DestroyManaged()
    Keyboard
    Keyboard
    Object::Flags
    ScriptingObject::FromInterface(void* interfaceObj, const ScriptingTypeHandle& interfaceType)
    ScriptingObject::FromInterface(T* interfaceObj)
    ScriptingObject::GetClass()
    ScriptingObject::GetID()
    ScriptingObject::GetManagedInstance()
    InputDevice::GetName()
    ScriptingObject::GetOrCreateManagedInstance()
    ScriptingObject::GetType()
    ScriptingObject::GetTypeHandle()
    ScriptingObject::HasManagedInstance()
    InputDevice::InputDevice(const SpawnParams& params, const StringView& name)
    ScriptingObject::Is(const ScriptingTypeHandle& type)
    ScriptingObject::Is(const MClass* type)
    ScriptingObject::Is()
    ScriptingObject::IsRegistered()
    ScriptingObject::NewObject(const ScriptingTypeHandle& typeHandle)
    ScriptingObject::NewObject()
    ScriptingObject::OnDeleteObject()
    ScriptingObject::OnManagedInstanceDeleted()
    ScriptingObject::OnScriptingDispose()
    ScriptingObject::RegisterObject()
    ScriptingObject::ScriptingObject(const SpawnParams& params)
    ScriptingObject::SetManagedInstance(MObject* instance)
    Keyboard
    ScriptingObject::ToInterface(ScriptingObject* obj, const ScriptingTypeHandle& interfaceType)
    ScriptingObject::ToInterface(ScriptingObject* obj)
    ScriptingObject::ToManaged(const ScriptingObject* obj)
    ScriptingObject::ToNative(MObject* obj)
    ScriptingObject::ToString()
    ScriptingObject::UnregisterObject()
    InputDevice::UpdateState()
    Object::~Object()
    ScriptingObject::~ScriptingObject()
    Assembly: FlaxEngine.dll
    File: Engine/Input/Keyboard.h
    Syntax
    public class Keyboard : public InputDevice

    Constructors

    Keyboard()

    Declaration
    protected Keyboard()

    Fields

    _prevState

    Declaration
    protected State _prevState
    Field Value
    State

    _state

    Declaration
    protected State _state
    Field Value
    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
    InputDevice::ResetState()

    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.

    Overrides
    InputDevice::Update(EventQueue& queue)
    • Improve this Doc
    • View Source
    In This Article
    Back to top Copyright © 2012-2024 Wojciech Figat