Enum input::Input
[−]
[src]
pub enum Input { Press(Button), Release(Button), Move(Motion), Text(String), Resize(u32, u32), Focus(bool), Cursor(bool), Close(CloseArgs), Render(RenderArgs), AfterRender(AfterRenderArgs), Update(UpdateArgs), Idle(IdleArgs), Custom(EventId, Arc<Any + Send + Sync>), }
Models input events.
Variants
Press(Button)
Pressed a button.
Release(Button)
Released a button.
Move(Motion)
Moved mouse cursor.
Text(String)
Text (usually from keyboard).
Resize(u32, u32)
Window got resized.
Focus(bool)
Window gained or lost focus.
Cursor(bool)
Window gained or lost cursor.
Close(CloseArgs)
Window closed.
Render(RenderArgs)
Render graphics.
AfterRender(AfterRenderArgs)
After rendering and swapping buffers.
Update(UpdateArgs)
Update the state of the application.
Idle(IdleArgs)
Do background tasks that can be done incrementally.
Custom(EventId, Arc<Any + Send + Sync>)
Custom event.
When comparing two custom events for equality,
they always return false
.
Trait Implementations
impl ControllerAxisEvent for Input
[src]
fn from_controller_axis_args(
args: ControllerAxisArgs,
_old_event: &Self
) -> Option<Self>
[src]
args: ControllerAxisArgs,
_old_event: &Self
) -> Option<Self>
Creates a controller axis event.
fn controller_axis<U, F>(&self, f: F) -> Option<U> where
F: FnMut(ControllerAxisArgs) -> U,
[src]
F: FnMut(ControllerAxisArgs) -> U,
Calls closure if this is a controller axis event.
fn controller_axis_args(&self) -> Option<ControllerAxisArgs>
[src]
Returns controller axis arguments.
impl MouseCursorEvent for Input
[src]
fn from_xy(x: f64, y: f64, _old_event: &Self) -> Option<Self>
[src]
Creates a mouse cursor event.
fn mouse_cursor<U, F>(&self, f: F) -> Option<U> where
F: FnMut(f64, f64) -> U,
[src]
F: FnMut(f64, f64) -> U,
Calls closure if this is a mouse cursor event.
fn mouse_cursor_args(&self) -> Option<[f64; 2]>
[src]
Returns mouse cursor arguments.
impl MouseRelativeEvent for Input
[src]
fn from_xy(x: f64, y: f64, _old_event: &Self) -> Option<Self>
[src]
Creates a mouse relative event.
fn mouse_relative<U, F>(&self, f: F) -> Option<U> where
F: FnMut(f64, f64) -> U,
[src]
F: FnMut(f64, f64) -> U,
Calls closure if this is a mouse relative event.
fn mouse_relative_args(&self) -> Option<[f64; 2]>
[src]
Returns mouse relative arguments.
impl MouseScrollEvent for Input
[src]
fn from_xy(x: f64, y: f64, _old_event: &Self) -> Option<Self>
[src]
Creates a mouse scroll event.
fn mouse_scroll<U, F>(&self, f: F) -> Option<U> where
F: FnMut(f64, f64) -> U,
[src]
F: FnMut(f64, f64) -> U,
Calls a closure if this is a mouse scroll event.
fn mouse_scroll_args(&self) -> Option<[f64; 2]>
[src]
Returns mouse scroll arguments.
impl GenericEvent for Input
[src]
fn event_id(&self) -> EventId
[src]
The id of this event.
fn with_args<'a, F, U>(&'a self, f: F) -> U where
F: FnMut(&Any) -> U,
[src]
F: FnMut(&Any) -> U,
Calls closure with arguments
impl AfterRenderEvent for Input
[src]
fn from_after_render_args(
args: &AfterRenderArgs,
_old_event: &Input
) -> Option<Self>
[src]
args: &AfterRenderArgs,
_old_event: &Input
) -> Option<Self>
Creates an after render event.
fn after_render<U, F>(&self, f: F) -> Option<U> where
F: FnMut(&AfterRenderArgs) -> U,
[src]
F: FnMut(&AfterRenderArgs) -> U,
Calls closure if this is an after render event.
fn after_render_args(&self) -> Option<AfterRenderArgs>
[src]
Returns after render arguments.
impl CloseEvent for Input
[src]
fn from_close_args(args: &CloseArgs, _old_event: &Input) -> Option<Self>
[src]
Creates a close event from arguments.
fn close<U, F>(&self, f: F) -> Option<U> where
F: FnMut(&CloseArgs) -> U,
[src]
F: FnMut(&CloseArgs) -> U,
Calls closure if this is a close event.
fn close_args(&self) -> Option<CloseArgs>
[src]
Returns close arguments.
impl CursorEvent for Input
[src]
fn from_cursor(cursor: bool, _old_event: &Self) -> Option<Self>
[src]
Creates a cursor event.
fn cursor<U, F>(&self, f: F) -> Option<U> where
F: FnMut(bool) -> U,
[src]
F: FnMut(bool) -> U,
Calls closure if this is a cursor event.
fn cursor_args(&self) -> Option<bool>
[src]
Returns cursor arguments.
impl FocusEvent for Input
[src]
fn from_focused(focused: bool, _old_event: &Self) -> Option<Self>
[src]
Creates a focus event.
fn focus<U, F>(&self, f: F) -> Option<U> where
F: FnMut(bool) -> U,
[src]
F: FnMut(bool) -> U,
Calls closure if this is a focus event.
fn focus_args(&self) -> Option<bool>
[src]
Returns focus arguments.
impl IdleEvent for Input
[src]
fn from_idle_args(args: &IdleArgs, _old_event: &Self) -> Option<Self>
[src]
Creates an idle event.
fn idle<U, F>(&self, f: F) -> Option<U> where
F: FnMut(&IdleArgs) -> U,
[src]
F: FnMut(&IdleArgs) -> U,
Calls closure if this is an idle event.
fn from_dt(dt: f64, old_event: &Self) -> Option<Self>
[src]
Creates an update event with delta time.
fn idle_args(&self) -> Option<IdleArgs>
[src]
Returns idle arguments.
impl PressEvent for Input
[src]
[src]
Creates a press event.
fn press<U, F>(&self, f: F) -> Option<U> where
F: FnMut(Button) -> U,
[src]
F: FnMut(Button) -> U,
Calls closure if this is a press event.
fn press_args(&self) -> Option<Button>
[src]
Returns press arguments.
impl ReleaseEvent for Input
[src]
[src]
Creates a release event.
fn release<U, F>(&self, f: F) -> Option<U> where
F: FnMut(Button) -> U,
[src]
F: FnMut(Button) -> U,
Calls closure if this is a release event.
fn release_args(&self) -> Option<Button>
[src]
Returns release arguments.
impl RenderEvent for Input
[src]
fn from_render_args(args: &RenderArgs, _old_event: &Self) -> Option<Self>
[src]
Creates a render event.
fn render<U, F>(&self, f: F) -> Option<U> where
F: FnMut(&RenderArgs) -> U,
[src]
F: FnMut(&RenderArgs) -> U,
Calls closure if this is a render event.
fn render_args(&self) -> Option<RenderArgs>
[src]
Returns render arguments.
impl ResizeEvent for Input
[src]
fn from_width_height(w: u32, h: u32, _old_event: &Self) -> Option<Self>
[src]
Creates a resize event.
fn resize<U, F>(&self, f: F) -> Option<U> where
F: FnMut(u32, u32) -> U,
[src]
F: FnMut(u32, u32) -> U,
Calls closure if this is a resize event.
fn resize_args(&self) -> Option<[u32; 2]>
[src]
Returns resize arguments.
impl TextEvent for Input
[src]
fn from_text(text: &str, _old_event: &Self) -> Option<Self>
[src]
Creates a text event.
fn text<U, F>(&self, f: F) -> Option<U> where
F: FnMut(&str) -> U,
[src]
F: FnMut(&str) -> U,
Calls closure if this is a text event.
fn text_args(&self) -> Option<String>
[src]
Returns text arguments.
impl TouchEvent for Input
[src]
fn from_touch_args(args: &TouchArgs, _old_event: &Self) -> Option<Self>
[src]
Creates a touch event.
fn touch<U, F>(&self, f: F) -> Option<U> where
F: FnMut(&TouchArgs) -> U,
[src]
F: FnMut(&TouchArgs) -> U,
Calls closure if this is a touch event.
fn touch_args(&self) -> Option<TouchArgs>
[src]
Returns touch arguments.
impl UpdateEvent for Input
[src]
fn from_update_args(args: &UpdateArgs, _old_event: &Self) -> Option<Self>
[src]
Creates an update event.
fn update<U, F>(&self, f: F) -> Option<U> where
F: FnMut(&UpdateArgs) -> U,
[src]
F: FnMut(&UpdateArgs) -> U,
Calls closure if this is an update event.
fn from_dt(dt: f64, old_event: &Self) -> Option<Self>
[src]
Creates an update event with delta time.
fn update_args(&self) -> Option<UpdateArgs>
[src]
Returns update arguments.
impl Clone for Input
[src]
fn clone(&self) -> Input
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for Input
[src]
impl PartialEq for Input
[src]
fn eq(&self, other: &Input) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl Decodable for Input
[src]
fn decode<D: Decoder>(d: &mut D) -> Result<Input, D::Error>
[src]
Deserialize a value using a Decoder
.
impl Encodable for Input
[src]
fn encode<S: Encoder>(&self, s: &mut S) -> Result<(), S::Error>
[src]
Serialize a value using an Encoder
.
impl From<Motion> for Input
[src]
impl From<RenderArgs> for Input
[src]
fn from(args: RenderArgs) -> Self
[src]
Performs the conversion.
impl From<AfterRenderArgs> for Input
[src]
fn from(args: AfterRenderArgs) -> Self
[src]
Performs the conversion.
impl From<UpdateArgs> for Input
[src]
fn from(args: UpdateArgs) -> Self
[src]
Performs the conversion.