Skip to content

InputEventJoypadButton

Eduard Gushchin edited this page Jun 21, 2026 · 5 revisions

InputEventJoypadButton

Back to API Reference

Namespace: Electron2D

Summary

Represents a gamepad button press or release.

Declaration

public class Electron2D.InputEventJoypadButton : Electron2D.InputEvent

Remarks

The event is delivered through Electron2D.Node._Input(Electron2D.InputEvent) and is also consumed by Electron2D.Input to update button state and by Electron2D.InputMap to update action bindings.

The device id is stored in Electron2D.InputEvent.Device. Unknown devices are registered as connected placeholder devices when a button event is processed.

Thread Safety

Instances are mutable and are not synchronized; use them from the input dispatch thread that owns the event.

Since

This class is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Input.IsJoyButtonPressed(System.Int32,Electron2D.JoyButton)
  • Electron2D.InputMap
  • Electron2D.JoyButton

Members

Member Kind Summary
ButtonIndex Property Gets or sets the gamepad button represented by this event.
Pressed Property Gets or sets whether the button is pressed.
Pressure Property Gets or sets the analog pressure for this button event.
Electron2D.InputEventJoypadButton() Constructor Initializes a new instance of the InputEventJoypadButton type.

Member Details

ButtonIndex

Kind: Property

public Electron2D.JoyButton ButtonIndex { get; set; }

Summary

Gets or sets the gamepad button represented by this event.

Remarks

Invalid button values do not match Electron2D.InputMap action bindings and are ignored by Electron2D.Input.IsJoyButtonPressed(System.Int32,Electron2D.JoyButton).

Value

A Electron2D.JoyButton value, or Electron2D.JoyButton.Invalid for an unmapped button.

Thread Safety

This property is not synchronized.

Since

This property is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.InputEventJoypadButton

Pressed

Kind: Property

public System.Boolean Pressed { get; set; }

Summary

Gets or sets whether the button is pressed.

Remarks

Pressed events update Electron2D.Input.IsJoyButtonPressed(System.Int32,Electron2D.JoyButton) and action state. Released events clear the corresponding button state.

Value

The current pressed value.

Thread Safety

This property is not synchronized.

Since

This property is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.InputEventJoypadButton

Pressure

Kind: Property

public System.Single Pressure { get; set; }

Summary

Gets or sets the analog pressure for this button event.

Remarks

Digital platform button events set this to 1.0 while pressed and 0.0 while released. Action bindings use this value when it is greater than zero.

Value

A value clamped to the range 0.0 through 1.0.

Thread Safety

This property is not synchronized.

Since

This property is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.InputEventJoypadButton

Electron2D.InputEventJoypadButton()

Kind: Constructor

public Electron2D.InputEventJoypadButton()

Summary

Initializes a new instance of the InputEventJoypadButton type.

Remarks

The new instance follows the lifetime and validation rules of its declaring type.

Thread Safety

This member is not synchronized. Call it from the thread that owns the related object unless the declaring type states otherwise.

Since

This API is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.InputEventJoypadButton

Clone this wiki locally