Enum event_types::Event
source · pub enum Event {
KeyboardEvent(KeyboardInputEvent),
MouseMovementEvent(MouseEvent),
OutputEvent(String),
WindowResizeEvent(Rectangle),
MousePositionEvent(MousePositionEvent),
ExitEvent,
}
Variants§
KeyboardEvent(KeyboardInputEvent)
An input event from a keyboard
MouseMovementEvent(MouseEvent)
An input event from a mouse
OutputEvent(String)
An event indicating that another entity wants to print the given String
.
WindowResizeEvent(Rectangle)
Tells an application that the window manager has resized or moved its window so that it knows to refresh its display and perform any necessary tasks, such as text reflow.
The new position and size of the window is given by the Rectangle
within,
and represents the content area within the window that is accessible to the application,
which excludes the window title bar, borders, etc.
MousePositionEvent(MousePositionEvent)
The event tells application about mouse’s position currently (including relative to a window and relative to a screen)
ExitEvent
Implementations§
source§impl Event
impl Event
sourcepub fn new_keyboard_event(kev: KeyEvent) -> Event
pub fn new_keyboard_event(kev: KeyEvent) -> Event
Create a new keyboard event
sourcepub fn new_output_event<S>(s: S) -> Eventwhere
S: Into<String>,
pub fn new_output_event<S>(s: S) -> Eventwhere S: Into<String>,
Create a new output event
sourcepub fn new_window_resize_event(new_position: Rectangle) -> Event
pub fn new_window_resize_event(new_position: Rectangle) -> Event
Create a new window resize event
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Event
impl Send for Event
impl Sync for Event
impl Unpin for Event
impl UnwindSafe for Event
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more