Search Results for

    Show / Hide Table of Contents

    Class Gamepad

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

    Inheritance
    Object
    ScriptingObject
    InputDevice
    Gamepad
    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()
    Gamepad
    Gamepad
    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)
    Gamepad
    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/Gamepad.h
    Syntax
    public class Gamepad : public InputDevice

    Constructors

    Gamepad(const Guid& productId, const String& name)

    Declaration
    protected Gamepad(const Guid& productId, const String& name)
    Parameters
    Guid productId

    String name

    Fields

    _mappedPrevState

    Declaration
    protected State _mappedPrevState
    Field Value
    State

    _mappedState

    Declaration
    protected State _mappedState
    Field Value
    State

    _productId

    Declaration
    protected Guid _productId
    Field Value
    Guid

    _state

    Declaration
    protected State _state
    Field Value
    State

    Layout

    The gamepad layout.

    Declaration
    public GamepadLayout Layout
    Field Value
    GamepadLayout

    Methods

    GetAxis(const GamepadAxis axis)

    Gets the gamepad axis value.

    Declaration
    public float GetAxis(const GamepadAxis axis) const
    Parameters
    GamepadAxis axis

    Gamepad axis to check

    Returns
    float

    Axis value.

    GetButton(const GamepadButton button)

    Gets the gamepad button state (true if being pressed during the current frame).

    Declaration
    public bool GetButton(const GamepadButton button) const
    Parameters
    GamepadButton button

    Gamepad button to check

    Returns
    bool

    True if user holds down the button, otherwise false.

    GetButtonDown(const GamepadButton button)

    Gets the gamepad button down state (true if was pressed during the current frame).

    Declaration
    public bool GetButtonDown(const GamepadButton button) const
    Parameters
    GamepadButton button

    Gamepad button to check

    Returns
    bool

    True if user starts pressing down the button, otherwise false.

    GetButtonUp(const GamepadButton button)

    Gets the gamepad button up state (true if was released during the current frame).

    Declaration
    public bool GetButtonUp(const GamepadButton button) const
    Parameters
    GamepadButton button

    Gamepad button to check

    Returns
    bool

    True if user releases the button, otherwise false.

    GetProductID()

    Gets the gamepad device type identifier.

    Declaration
    public Guid GetProductID() const
    Returns
    Guid

    The id.

    GetState(State& result)

    Gets the current gamepad state.

    Declaration
    public void GetState(State& result) const
    Parameters
    State result

    The result.

    Returns
    void

    IsAnyButtonDown()

    Checks if any gamepad button is currently pressed.

    Declaration
    public bool IsAnyButtonDown() const
    Returns
    bool

    ResetColor()

    Resets the color of the gamepad light to the default. Ignored if controller does not support this.

    Declaration
    public virtual void ResetColor()

    ResetState()

    Resets the input device state. Called when application looses focus.

    Declaration
    public virtual void ResetState() override
    Overrides
    InputDevice::ResetState()

    SetColor(const Color& color)

    Sets the color of the gamepad light. Ignored if controller does not support this.

    Declaration
    public virtual void SetColor(const Color& color)
    Parameters
    Color color

    The color.

    SetVibration(const GamepadVibrationState& state)

    Sets the state of the gamepad vibration. Ignored if controller does not support this.

    Declaration
    public virtual void SetVibration(const GamepadVibrationState& state)
    Parameters
    GamepadVibrationState state

    The state.

    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