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 more