Skip to content

GamepadDevice class reference

Alan Stagner edited this page Jun 9, 2020 · 1 revision

Methods

bool GetButton(Button btn) - Gets whether the button is pressed


bool GetButtonDown(Button btn) - Gets whether the button was just pressed this frame


bool GetButtonUp(Button btn) - Gets whether the button was just released this frame


float GetAxis(Axis axis) - Gets the value of the given axis


void Vibrate(float magnitude, int duration) - Start a rumble effect at the given magnitude for the given number of milliseconds (note: not all gamepads support vibration)


void StopVibration() - Stops any previously started vibration

Properties

GamepadState CurrentState { get; } - Gets a snapshot of the current gamepad state


Event<GamepadButtonPressedHandler> OnButtonPressed - Event triggered when a button is pressed


Event<GamepadButtonReleasedHandler> OnButtonReleased - Event triggered when a button is released


StringView Name { get; } - Gets the name of the gamepad device