Struct cursive::event::EventTrigger [−][src]
pub struct EventTrigger { /* fields omitted */ }
Expand description
A trigger that only selects some types of events.
It is meant to be stored in views.
Implementations
Create a new EventTrigger
using the given function as filter.
pub fn from_fn_and_tag<F, T>(f: F, tag: T) -> EventTrigger where
F: 'static + Fn(&Event) -> bool,
T: Any + Debug,
pub fn from_fn_and_tag<F, T>(f: F, tag: T) -> EventTrigger where
F: 'static + Fn(&Event) -> bool,
T: Any + Debug,
Create a new EventTrigger
.
Check if this trigger has the given tag.
Examples
use cursive_core::event::{Event, EventTrigger};
let event = Event::CtrlChar('c');
let trigger: EventTrigger = event.clone().into();
assert!(
trigger.has_tag(&event),
"Trigger does not recognize its own tag."
);
Returns an EventTrigger
that only accepts arrow keys.
Only bare arrow keys without modifiers (Shift, Ctrl, Alt) will be accepted.
Returns an EventTrigger
that only accepts mouse events.
Returns an EventTrigger
that accepts any event.
Returns an EventTrigger
that doesn’t accept any event.
Returns an EventTrigger
that applies if either self
or other
applies.
Trait Implementations
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.