pub struct Input { /* private fields */ }Expand description
Aggregates raw input collected during the current frame.
Implementations§
Source§impl Input
impl Input
Sourcepub fn rel_mouse_pos(&self) -> Vec2i
pub fn rel_mouse_pos(&self) -> Vec2i
Returns the mouse position relative to the container that currently owns focus.
Sourcepub fn text_input(&self) -> &str
pub fn text_input(&self) -> &str
Returns the accumulated UTF-8 text entered this frame.
Returns the currently held mouse buttons.
Sourcepub fn mousedown(&mut self, x: i32, y: i32, btn: MouseButton)
pub fn mousedown(&mut self, x: i32, y: i32, btn: MouseButton)
Records that the specified mouse button was pressed.
Sourcepub fn mouseup(&mut self, x: i32, y: i32, btn: MouseButton)
pub fn mouseup(&mut self, x: i32, y: i32, btn: MouseButton)
Records that the specified mouse button was released.
Sourcepub fn keydown_code(&mut self, code: KeyCode)
pub fn keydown_code(&mut self, code: KeyCode)
Records that a navigation key was pressed.
Sourcepub fn keyup_code(&mut self, code: KeyCode)
pub fn keyup_code(&mut self, code: KeyCode)
Records that a navigation key was released.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Input
impl RefUnwindSafe for Input
impl Send for Input
impl Sync for Input
impl Unpin for Input
impl UnwindSafe for Input
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