unpress

fun unpress(button: Button, command: Command)

Sets the command supplier to be executed when the specified button is released.

This overload accepts a supplier of a Command. If the button was previously bound, only the release command is updated; the press command remains unchanged.

Parameters

button

The button to bind.

command

The command supplier for the release event.

Example:

unpress(Button.A, MyReleaseCommand())

Overload just for Jayden Sun


fun unpress(button: Button, command: () -> Unit)

Sets the command supplier to be executed when the specified button is released.

This overload accepts a lambda of type () -> Unit, which is wrapped in an InstantCommand. Useful for simple actions that do not require a full Command implementation.

Parameters

button

The button to bind.

command

The lambda to execute for the release event.

Example:

unpress(Button.B) { println("Released B!") }

Overload just for Jayden Sun