【Feature】 Allows creation of events from callback.
not-elm opened this issue · comments
not-elm commented
I would like to be able to generate events from callbacks with the proposal mentioned in the PR#4.
This allows gamepad buttons to be passed to events.
commands.spawn(ButtonSequence::new(
[
GamepadButtonType::North,
GamepadButtonType::East,
GamepadButtonType::South,
GamepadButtonType::West,
],
|gamepad: Gamepad|{
MyEvent(gamepad)
}
).time_limit(Duration::from_secs(1)));
not-elm commented
PS Controller have been broken, so it may take some time to test .
Shane Celis commented
I got you, fam. See PR #6.
commands.add(ButtonSequence::new(
action::send_event_with_input(|gamepad| MyEvent(gamepad)),
[
GamepadButtonType::North,
GamepadButtonType::East,
GamepadButtonType::South,
GamepadButtonType::West,
]
).time_limit(Duration::from_secs(1)));
I thought about switching the arguments to ButtonSequence::new()
and KeySequence::new()
too. Looks good for ButtonSequence
. Looks a little redundant for KeySequence
because it reads:
KeySequence::new(keyseq! { ctrl-alt-Delete }, quit_everything)
But maybe that's ok.
not-elm commented
I would like to update this library. 0.3.1 is fine?
Shane Celis commented
I’d suggest 0.4.0 because it’s a breaking change.
not-elm commented
I see, thank you.
not-elm commented
I released version 0.4.0!
This issue close.