pub struct Event<'alloc>(/* private fields */);Expand description
Normalized mouse input event containing action, button, modifiers, and surface-space position.
Implementations§
Source§impl<'alloc> Event<'alloc>
impl<'alloc> Event<'alloc>
Sourcepub fn new_with_alloc<'ctx: 'alloc, Ctx>(
alloc: &'alloc Allocator<'ctx, Ctx>,
) -> Result<Self>
pub fn new_with_alloc<'ctx: 'alloc, Ctx>( alloc: &'alloc Allocator<'ctx, Ctx>, ) -> Result<Self>
Create a new mouse event instance with a custom allocator.
See the crate-level documentation regarding custom memory management and lifetimes.
Sourcepub fn set_action(&mut self, action: Action) -> &mut Self
pub fn set_action(&mut self, action: Action) -> &mut Self
Set the event action.
Set the event button.
Get the event button.
Sourcepub fn set_mods(&mut self, mods: Mods) -> &mut Self
pub fn set_mods(&mut self, mods: Mods) -> &mut Self
Set keyboard modifiers held during the event.
Sourcepub fn set_position(&mut self, pos: Position) -> &mut Self
pub fn set_position(&mut self, pos: Position) -> &mut Self
Set the event position in surface-space pixels.
Trait Implementations§
Auto Trait Implementations§
impl<'alloc> Freeze for Event<'alloc>
impl<'alloc> RefUnwindSafe for Event<'alloc>
impl<'alloc> !Send for Event<'alloc>
impl<'alloc> !Sync for Event<'alloc>
impl<'alloc> Unpin for Event<'alloc>
impl<'alloc> UnsafeUnpin for Event<'alloc>
impl<'alloc> UnwindSafe for Event<'alloc>
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