[−][src]Enum cursive::event::Event
Represents an event as seen by the application.
Variants
Event fired when the window is resized.
Event fired regularly when a auto-refresh is set.
Char(char)
A character was entered (includes numbers, punctuation, ...).
CtrlChar(char)
A character was entered with the Ctrl key pressed.
AltChar(char)
A character was entered with the Alt key pressed.
Key(Key)
A non-character key was pressed.
Shift(Key)
A non-character key was pressed with the Shift key pressed.
Alt(Key)
A non-character key was pressed with the Alt key pressed.
AltShift(Key)
A non-character key was pressed with the Shift and Alt keys pressed.
Ctrl(Key)
A non-character key was pressed with the Ctrl key pressed.
CtrlShift(Key)
A non-character key was pressed with the Ctrl and Shift keys pressed.
CtrlAlt(Key)
A non-character key was pressed with the Ctrl and Alt keys pressed.
A mouse event was sent.
Fields of Mouse
offset: XY<usize>
Position of the top-left corner of the view receiving this event.
position: XY<usize>
Position of the mouse when this event was fired.
event: MouseEvent
The mouse event itself.
An unknown event was received.
Implementations
impl Event
[src]
pub fn mouse_position(&self) -> Option<XY<usize>>
[src]
Returns the position of the mouse, if self
is a mouse event.
pub fn mouse_position_mut(&mut self) -> Option<&mut XY<usize>>
[src]
Returns a mutable reference to the position of the mouse/
Returns None
if self
is not a mouse event.
pub fn relativize<V>(&mut self, top_left: V) where
V: Into<XY<usize>>,
[src]
V: Into<XY<usize>>,
Update self
with the given offset.
If self
is a mouse event, adds top_left
to its offset.
Otherwise, do nothing.
pub fn relativized<V>(&self, top_left: V) -> Event where
V: Into<XY<usize>>,
[src]
V: Into<XY<usize>>,
Returns a cloned, relativized event.
If self
is a mouse event, adds top_left
to its offset.
Otherwise, returns a simple clone.
Trait Implementations
impl Clone for Event
[src]
impl Debug for Event
[src]
impl Eq for Event
[src]
impl From<Event> for EventTrigger
[src]
pub fn from(event: Event) -> EventTrigger
[src]
impl From<Key> for Event
[src]
impl From<char> for Event
[src]
impl Hash for Event
[src]
pub fn hash<__H>(&self, state: &mut __H) where
__H: Hasher,
[src]
__H: Hasher,
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl PartialEq<Event> for Event
[src]
impl StructuralEq for Event
[src]
impl StructuralPartialEq for Event
[src]
Auto Trait Implementations
impl RefUnwindSafe for Event
[src]
impl Send for Event
[src]
impl Sync for Event
[src]
impl Unpin for Event
[src]
impl UnwindSafe for Event
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> CallHasher for T where
T: Hash + ?Sized,
[src]
T: Hash + ?Sized,
impl<T> Erased for T
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> With for T
[src]
pub fn wrap_with<U, F>(self, f: F) -> U where
F: FnOnce(Self) -> U,
[src]
F: FnOnce(Self) -> U,
pub fn with<F>(self, f: F) -> Self where
F: FnOnce(&mut Self),
[src]
F: FnOnce(&mut Self),
pub fn try_with<E, F>(self, f: F) -> Result<Self, E> where
F: FnOnce(&mut Self) -> Result<(), E>,
[src]
F: FnOnce(&mut Self) -> Result<(), E>,
pub fn with_if<F>(self, condition: bool, f: F) -> Self where
F: FnOnce(&mut Self),
[src]
F: FnOnce(&mut Self),