Struct ambient_api_core::prelude::input::Input
source · pub struct Input {
pub keys: HashSet<KeyCode>,
pub mouse_position: Vec2,
pub mouse_delta: Vec2,
pub mouse_wheel: f32,
pub mouse_buttons: HashSet<MouseButton>,
}
Available on crate feature
client
only.Expand description
The state of a player’s raw input. Get these with get or get_previous.
Fields§
§keys: HashSet<KeyCode>
All of the keys being pressed this frame.
mouse_position: Vec2
The current position of the mouse.
mouse_delta: Vec2
The movement of the mouse since the last frame. Note that this is not affected by cursor locking, unlike Self::mouse_position.
Use this for any kind of movement that should be relative to the mouse’s position, such as camera rotation.
mouse_wheel: f32
The current scroll position.
All of the mouse buttons being pressed this frame.
Implementations§
Trait Implementations§
source§impl PartialEq for Input
impl PartialEq for Input
impl StructuralPartialEq for Input
Auto Trait Implementations§
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