pub enum CursorEventContent {
Moved(PxPosition),
Pressed(PressKeyEventType),
Released(PressKeyEventType),
Scroll(ScrollEventContent),
}Expand description
Enumeration of all possible cursor event types.
CursorEventContent represents the different kinds of interactions
that can occur with cursor or touch input, including button presses,
releases, and scroll actions.
Variants§
Moved(PxPosition)
The pointer moved to a new absolute position.
Pressed(PressKeyEventType)
A cursor button or touch point was pressed.
Released(PressKeyEventType)
A cursor button or touch point was released.
Scroll(ScrollEventContent)
A scroll action occurred (mouse wheel or touch drag).
Implementations§
Source§impl CursorEventContent
impl CursorEventContent
Sourcepub fn from_press_event(
state: ElementState,
button: MouseButton,
) -> Option<Self>
pub fn from_press_event( state: ElementState, button: MouseButton, ) -> Option<Self>
Creates a cursor press/release event from winit mouse button events.
This method converts winit’s mouse button events into Tessera’s cursor event format. It handles the three standard mouse buttons (left, right, middle) and ignores any additional buttons that may be present on some mice.
§Arguments
state- Whether the button was pressed or releasedbutton- Which mouse button was affected
§Returns
Some(CursorEventContent)for supported mouse buttonsNonefor unsupported mouse buttons
Sourcepub fn from_scroll_event(delta: MouseScrollDelta) -> Self
pub fn from_scroll_event(delta: MouseScrollDelta) -> Self
Creates a scroll event from winit mouse wheel events.
This method converts winit’s mouse scroll delta into Tessera’s scroll event format while preserving whether the platform reported the value in line or pixel units.
§Arguments
delta- The scroll delta from winit
§Returns
A CursorEventContent::Scroll event with raw line or pixel delta
values.
Trait Implementations§
Source§impl Clone for CursorEventContent
impl Clone for CursorEventContent
Source§fn clone(&self) -> CursorEventContent
fn clone(&self) -> CursorEventContent
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CursorEventContent
impl Debug for CursorEventContent
Source§impl PartialEq for CursorEventContent
impl PartialEq for CursorEventContent
impl StructuralPartialEq for CursorEventContent
Auto Trait Implementations§
impl Freeze for CursorEventContent
impl RefUnwindSafe for CursorEventContent
impl Send for CursorEventContent
impl Sync for CursorEventContent
impl Unpin for CursorEventContent
impl UnsafeUnpin for CursorEventContent
impl UnwindSafe for CursorEventContent
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.