pub trait Trigger<U> {
/// Updates state and returns true if triggering on event.
fn trigger(&mut self, event: &U) -> bool;
}
This will make it possible to handle arbitrary mappings with Box<Trigger>. For example, in Piston we have a FirstPerson camera controller which uses FirstPersonSettings. The key controls are limited to the keyboard. By using Box<Trigger> instead we can for example control the camera with both keyboard and gamepad at the same time.
This will make it possible to handle arbitrary mappings with
Box<Trigger>
. For example, in Piston we have aFirstPerson
camera controller which usesFirstPersonSettings
. The key controls are limited to the keyboard. By usingBox<Trigger>
instead we can for example control the camera with both keyboard and gamepad at the same time.