bindings
Extension function for XboxController to bind multiple button-command pairs using a DSL builder.
This is the recommended way to configure button bindings. The builder allows you to specify press and release commands for each button in a clear, declarative style.
Parameters
builder
Lambda with receiver for configuring button bindings. Use ButtonBindingsBuilder to specify press, release, and hold commands for each button.
Example:
controller.bindings {
press(Button.A, MyCommand())
release(Button.A, MyReleaseCommand())
press(Button.B) { println("Pressed B!") }
hold(Button.B) { println("Holding B!") }
}
Content copied to clipboard