pub enum MouseWheelSource {
Unknown,
Wheel,
Trackpad,
Momentum,
}Expand description
What is driving an crate::Event::MouseWheel event.
This lets a crate::ScrollArea treat the different kinds of scrolling differently,
e.g. rubber-band past the edge while the fingers are on the trackpad,
but bounce during the system-driven momentum phase.
This is about mice and trackpads. Touch screens don’t produce crate::Event::MouseWheel
events at all; they scroll by dragging with the pointer (see crate::Event::Touch).
§Platform-specific
- macOS:
Self::Wheel,Self::TrackpadorSelf::Momentum. - Wayland, Windows, X11, web: always
Self::Unknown, until winit reports the source.
Variants§
Unknown
The platform doesn’t say.
Wheel
A physical wheel, usually on a mouse.
Trackpad
Fingers moving on a trackpad (or similar touch surface, like a Magic Mouse).
Not a touch screen: those scroll by dragging with the pointer, see crate::Event::Touch.
On platforms that report a crate::TouchPhase, the fingers are on the trackpad
from crate::TouchPhase::Start until crate::TouchPhase::End.
Momentum
The system is continuing a finger scroll after the fingers were lifted, with decaying speed, such as the “momentum phase” on macOS.
On platforms that report a crate::TouchPhase, this gets its own
crate::TouchPhase::Start … crate::TouchPhase::End cycle after the finger one.
Trait Implementations§
Source§impl Clone for MouseWheelSource
impl Clone for MouseWheelSource
Source§fn clone(&self) -> MouseWheelSource
fn clone(&self) -> MouseWheelSource
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for MouseWheelSource
Source§impl Debug for MouseWheelSource
impl Debug for MouseWheelSource
impl Eq for MouseWheelSource
Source§impl Hash for MouseWheelSource
impl Hash for MouseWheelSource
Source§impl PartialEq for MouseWheelSource
impl PartialEq for MouseWheelSource
impl StructuralPartialEq for MouseWheelSource
Auto Trait Implementations§
impl Forget for MouseWheelSource
impl Freeze for MouseWheelSource
impl Move for MouseWheelSource
impl RefUnwindSafe for MouseWheelSource
impl Send for MouseWheelSource
impl Sync for MouseWheelSource
impl Unpin for MouseWheelSource
impl UnsafeUnpin for MouseWheelSource
impl UnwindSafe for MouseWheelSource
Blanket Implementations§
impl<T> AsId for T
impl<T> AsIdSalt for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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> ⓘ
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> ⓘ
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