record
fun record(holdDurationNanos: Long = 0, callback: (KeyBinder.Bind) -> Unit, function: () -> Boolean)
Begin recording for a keybind. This will return a CompletableFuture that will complete when the keybind is recorded.
The keybind will be registered when the CompletableFuture completes.
Since
0.24.0
Parameters
hold Duration Nanos
the duration that the keys have to be pressed in the resultant keybind
function
the function that will be run when the keybind is pressed
Throws
Cancellation Exception
if Keys.ESCAPE is pressed, or if a new recording is started before this one is completed.
if the keybind is already present