Show / Hide Table of Contents

# Class GamepadState

Exposes the game gamepad state to dalamud.

Will block game's gamepad input if NavEnableGamepad is set.

##### Inheritance

System.Object
GamepadState

##### Implements

System.IDisposable

##### Inherited Members

System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()

###### Namespace: Dalamud.Game.ClientState.GamePad

###### Assembly: Dalamud.dll

##### Syntax

    public class GamepadState : IDisposable

### Constructors

| Improve this Doc View Source

#### GamepadState(ClientStateAddressResolver)

Initializes a new instance of the GamepadState class.

##### Declaration

    public GamepadState(ClientStateAddressResolver resolver)

##### Parameters

Type | Name | Description
--- | --- | ---
Dalamud.Game.ClientState.ClientStateAddressResolver | resolver | Resolver knowing the pointer to the GamepadPoll function.

### Properties

| Improve this Doc View Source

#### GamepadInputAddress

Gets the pointer to the current instance of the GamepadInput struct.

##### Declaration

    public IntPtr GamepadInputAddress { get; }

##### Property Value

Type | Description
--- | ---
System.IntPtr |

| Improve this Doc View Source

#### LeftStickDown

Gets the state of the left analogue stick in the down direction between 0 (not tilted) and 1 (max tilt).

##### Declaration

    public float LeftStickDown { get; }

##### Property Value

Type | Description
--- | ---
System.Single |

| Improve this Doc View Source

#### LeftStickLeft

Gets the state of the left analogue stick in the left direction between 0 (not tilted) and 1 (max tilt).

##### Declaration

    public float LeftStickLeft { get; }

##### Property Value

Type | Description
--- | ---
System.Single |

| Improve this Doc View Source

#### LeftStickRight

Gets the state of the left analogue stick in the right direction between 0 (not tilted) and 1 (max tilt).

##### Declaration

    public float LeftStickRight { get; }

##### Property Value

Type | Description
--- | ---
System.Single |

| Improve this Doc View Source

#### LeftStickUp

Gets the state of the left analogue stick in the up direction between 0 (not tilted) and 1 (max tilt).

##### Declaration

    public float LeftStickUp { get; }

##### Property Value

Type | Description
--- | ---
System.Single |

| Improve this Doc View Source

#### RightStickDown

Gets the state of the right analogue stick in the down direction between 0 (not tilted) and 1 (max tilt).

##### Declaration

    public float RightStickDown { get; }

##### Property Value

Type | Description
--- | ---
System.Single |

| Improve this Doc View Source

#### RightStickLeft

Gets the state of the right analogue stick in the left direction between 0 (not tilted) and 1 (max tilt).

##### Declaration

    public float RightStickLeft { get; }

##### Property Value

Type | Description
--- | ---
System.Single |

| Improve this Doc View Source

#### RightStickRight

Gets the state of the right analogue stick in the right direction between 0 (not tilted) and 1 (max tilt).

##### Declaration

    public float RightStickRight { get; }

##### Property Value

Type | Description
--- | ---
System.Single |

| Improve this Doc View Source

#### RightStickUp

Gets the state of the right analogue stick in the up direction between 0 (not tilted) and 1 (max tilt).

##### Declaration

    public float RightStickUp { get; }

##### Property Value

Type | Description
--- | ---
System.Single |

### Methods

| Improve this Doc View Source

#### Dispose()

Disposes this instance, alongside its hooks.

##### Declaration

    public void Dispose()

| Improve this Doc View Source

#### Enable()

Enables the hook of the GamepadPoll function.

##### Declaration

    public void Enable()

| Improve this Doc View Source

#### Finalize()

Finalizes an instance of the GamepadState class.

##### Declaration

    protected void Finalize()

| Improve this Doc View Source

#### Pressed(GamepadButtons)

Gets whether `button` has been pressed.

Only true on first frame of the press. If ImGuiConfigFlags.NavEnableGamepad is set, this is unreliable.

##### Declaration

    public float Pressed(GamepadButtons button)

##### Parameters

Type | Name | Description
--- | --- | ---
GamepadButtons | button | The button to check for.

##### Returns

Type | Description
--- | ---
System.Single | 1 if pressed, 0 otherwise.

| Improve this Doc View Source

#### Raw(GamepadButtons)

Gets the raw state of `button`.

Is set the entire time a button is pressed down.

##### Declaration

    public float Raw(GamepadButtons button)

##### Parameters

Type | Name | Description
--- | --- | ---
GamepadButtons | button | The button to check for.

##### Returns

Type | Description
--- | ---
System.Single | 1 the whole time button is pressed, 0 otherwise.

| Improve this Doc View Source

#### Released(GamepadButtons)

Gets whether `button` has been released.

Only true the frame after release. If ImGuiConfigFlags.NavEnableGamepad is set, this is unreliable.

##### Declaration

    public float Released(GamepadButtons button)

##### Parameters

Type | Name | Description
--- | --- | ---
GamepadButtons | button | The button to check for.

##### Returns

Type | Description
--- | ---
System.Single | 1 if released, 0 otherwise.

| Improve this Doc View Source

#### Repeat(GamepadButtons)

Gets whether `button` is being pressed.

True in intervals if button is held down. If ImGuiConfigFlags.NavEnableGamepad is set, this is unreliable.

##### Declaration

    public float Repeat(GamepadButtons button)

##### Parameters

Type | Name | Description
--- | --- | ---
GamepadButtons | button | The button to check for.

##### Returns

Type | Description
--- | ---
System.Single | 1 if still pressed during interval, 0 otherwise or in between intervals.

### Implements

System.IDisposable