pub enum PointerSource {
Mouse,
Touch,
Stylus,
Unknown,
}Expand description
The kind of physical device that produced a pointer event.
Threaded from the platform layer (Android MotionEvent tool type, winit
PointerSource/ButtonSource, web PointerEvent.pointerType) so input
consumers can behave differently for finger vs. mouse input — for example a
text field shows draggable finger handles only for PointerSource::Touch
/ PointerSource::Stylus and keeps a clean caret for a mouse.
Variants§
Mouse
A mouse or other indirect precise pointer (desktop, web "mouse").
Touch
A finger on a touchscreen (Android finger, winit touch, web "touch").
Stylus
A stylus/pen (Android stylus/eraser, winit tablet tool, web "pen").
Unknown
The platform did not report a device type.
Implementations§
Source§impl PointerSource
impl PointerSource
Sourcepub fn is_touch_like(self) -> bool
pub fn is_touch_like(self) -> bool
Whether this source is a direct-touch device (finger or stylus) for which platforms show draggable selection handles rather than a caret.
Trait Implementations§
Source§impl Clone for PointerSource
impl Clone for PointerSource
Source§fn clone(&self) -> PointerSource
fn clone(&self) -> PointerSource
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 PointerSource
Source§impl Debug for PointerSource
impl Debug for PointerSource
Source§impl Default for PointerSource
impl Default for PointerSource
Source§fn default() -> PointerSource
fn default() -> PointerSource
impl Eq for PointerSource
Source§impl Hash for PointerSource
impl Hash for PointerSource
Source§impl PartialEq for PointerSource
impl PartialEq for PointerSource
Source§fn eq(&self, other: &PointerSource) -> bool
fn eq(&self, other: &PointerSource) -> bool
self and other values to be equal, and is used by ==.