pub struct Input { /* private fields */ }
Expand description
Contains and manages everything related to the egui
input
such as the location of the mouse or the pressed keys
Implementations§
Source§impl Input
impl Input
Sourcepub fn update(&mut self, ctx: &Context)
pub fn update(&mut self, ctx: &Context)
It updates egui of what is happening in the input (keys pressed, mouse position, etc), but it doesn’t updates the information of the pressed characters, to update that information you have to use the function [text_input_event](Input:: text_input_event)
Sourcepub fn set_scale_factor(&mut self, scale_factor: f32, (w, h): (f32, f32))
pub fn set_scale_factor(&mut self, scale_factor: f32, (w, h): (f32, f32))
Set the scale_factor and update the screen_rect
Sourcepub fn resize_event(&mut self, w: f32, h: f32)
pub fn resize_event(&mut self, w: f32, h: f32)
Update screen_rect data with window size
Sourcepub fn mouse_wheel_event(&mut self, x: f32, y: f32)
pub fn mouse_wheel_event(&mut self, x: f32, y: f32)
lets you know the rotation of the mouse wheel
Sourcepub fn text_input_event(&mut self, ch: char)
pub fn text_input_event(&mut self, ch: char)
lets know what character is pressed on the keyboard
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
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> HasMut<T> for T
impl<T> HasMut<T> for T
Source§fn retrieve_mut(&mut self) -> &mut T
fn retrieve_mut(&mut self) -> &mut T
Method to retrieve the context type as mutable.
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more