InputEventJoypadButton
A digital controller-button event with an index and device.
ButtonIndex selects the logical button, Device selects the controller and Pressed describes the state transition. Prefer InputMap actions for rebindable controls; use a direct index when a particular button on a particular device is required.
Pressure is obsolete in the SDK and is not populated by the engine. Do not use it for analog trigger strength: axes use InputEventJoypadMotion. Button-event action matching has digital strength, 1 or 0.
See InputEventMouseButton for the complete device-filtering example. It does not simulate connecting a real controller.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
InputEventJoypadButtonConstructor
public InputEventJoypadButton();Creates an event without submitting it: button index 0, Pressed = false and initial stored pressure 0. Device is inherited from InputEvent; constructing the object does not connect a controller.
Properties3
ButtonIndexProperty
public JoyButton ButtonIndex { get; set; }Logical JoyButton index in the event. Check Device separately to select a controller. The index is neither a device ID nor a universal physical button label.
PressedProperty
public bool Pressed { get; set; }Event press state; false represents release for an ordinary non-cancelled event. Button-to-action matching reports strength 1 for press and 0 for release, independent of stored Pressure.
PressureProperty · Deprecated
public float Pressure { get; set; }Obsolete in the installed C# SDK. The engine does not populate this field with button pressure; its ordinary value is 0. A programmatically stored float can be read, but it neither turns the button into an analog axis nor determines GetActionStrength. Use InputEventJoypadMotion for analog axes.
Methods5
GetButtonIndexJoyButton
public JoyButton GetButtonIndex();Returns ButtonIndex without polling the controller.
JoyButtonEvent JoyButton index.
GetPressurefloat
public float GetPressure();Returns Pressure without polling the controller. The Pressure property is obsolete; do not use this value for analog input.
floatStored float, not engine-measured button pressure.
SetButtonIndexvoid
public void SetButtonIndex(JoyButton buttonIndex);Sets ButtonIndex using the property rules without submitting the event.
| Name | Type | Default |
|---|---|---|
buttonIndex | JoyButton | — |
buttonIndexNew ButtonIndex value.
SetPressedvoid
public void SetPressed(bool pressed);Sets Pressed using the property rules without submitting the event.
| Name | Type | Default |
|---|---|---|
pressed | bool | — |
pressedNew Pressed value.
SetPressurevoid
public void SetPressure(float pressure);Stores the supplied float without clamping. Does not obtain device pressure or change digital action strength; the Pressure property is obsolete.
| Name | Type | Default |
|---|---|---|
pressure | float | — |
pressureNew Pressure value.