Class Gamepad
Represents a single hardware gamepad device. Used by the Input to report raw gamepad input events.
Inherited Members
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
_mappedState
_productId
_state
Layout
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
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. |