pub struct Pointer {
pub pos: Option<Pos2>,
pub buttons: [bool; 5],
pub modifiers: Modifiers,
pub platform: Option<Platform>,
pub modifiers_applied: bool,
pub now: f64,
pub reset_clicks: bool,
pub view: Option<Rect>,
/* private fields */
}Fields§
§pos: Option<Pos2>§modifiers: Modifiers§platform: Option<Platform>The emulated OS (platform_set); None keeps the host’s. Applied to
egui (Context::set_os) by drain_input, and it decides how
Modifiers map to egui’s.
modifiers_applied: boolWhether the last pass’s raw.modifiers were this pointer’s (see
drain_input): the user’s own modifiers apply otherwise.
now: f64egui’s clock for the frame being drained, set by
drain_input
before the frame’s commands run.
reset_clicks: boolSet by click_gap: the queue replaces egui’s
PointerState with a fresh one after this frame’s commands.
view: Option<Rect>The 3D viewport rect of the last frame, set by drain_input before
the frame’s commands run: touch maps viewport-relative points
through it.
Implementations§
Source§impl Pointer
impl Pointer
pub fn state(&self) -> PointerState
pub fn moved(&mut self, x: f32, y: f32, out: &mut Vec<Event>)
Sourcepub fn click_gap(&mut self) -> bool
pub fn click_gap(&mut self) -> bool
Start a NEW click sequence: forget egui’s click history when an injected click is still inside its multi-click window. Returns whether it did.
egui counts clicks by time, and checks the place only against the LAST click, so a click on one widget a few frames (1/60 s each headless) before a double click on another makes the double a TRIPLE, and a widget clicked twice by two scripted single clicks reads the second as a double (ecad-kicad-dialog-folders-2026-09-23).
The history is egui’s PointerState, whose click times are private;
the queue swaps in PointerState::default() (its options are refreshed
every pass). egui’s CLOCK is not touched: the first version jumped it
past the window instead, and the app’s own timers saw the jump, so a
toast aged 0.6 s per click (ecad-mcp-click-count-export-wording).
The window is the TRIPLE one, twice the double’s: the second click of
a new double looks two clicks back. Nothing is reset while a button is
held (a drag in progress lives in the same state), or when the last
click is already outside the window.
pub fn gone(&mut self, out: &mut Vec<Event>)
pub fn wheel(&mut self, dx: f32, dy: f32, unit: WheelUnit, out: &mut Vec<Event>)
Sourcepub fn egui_modifiers(&self) -> Modifiers
pub fn egui_modifiers(&self) -> Modifiers
The held modifiers as this pointer’s platform reports them.
pub fn set_modifiers(&mut self, m: Modifiers)
pub fn key( &mut self, name: &str, pressed: bool, repeat: bool, out: &mut Vec<Event>, ) -> Result<(), String>
Sourcepub fn touch(
&mut self,
device: u64,
space: TouchSpace,
points: &[TouchPoint],
cancel_all: bool,
out: &mut Vec<Event>,
) -> Result<Vec<HeldTouch>, String>
pub fn touch( &mut self, device: u64, space: TouchSpace, points: &[TouchPoint], cancel_all: bool, out: &mut Vec<Event>, ) -> Result<Vec<HeldTouch>, String>
One touch batch: every contact change of one platform touch event,
delivered in ONE frame as egui Event::Touches on touch device
device (contact ids are unique per device).
The whole batch is checked first and nothing is sent if any change
is invalid: a start of a held id, a move/end/cancel of an id
not held, a non-finite point, or viewport space with no viewport
drawn. cancel_all cancels every contact still held on the device
after the batch’s own changes. Returns the device’s held contacts in
the batch’s space.
pub fn text(&mut self, text: &str, out: &mut Vec<Event>)
Trait Implementations§
Auto Trait Implementations§
impl Forget for Pointer
impl Freeze for Pointer
impl Move for Pointer
impl RefUnwindSafe for Pointer
impl Send for Pointerwhere
RawVecInner: Send,
impl Sync for Pointerwhere
RawVecInner: Sync,
impl Unpin for Pointer
impl UnsafeUnpin for Pointer
impl UnwindSafe for Pointerwhere
RawVecInner: UnwindSafe,
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
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<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§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.Source§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.Source§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.Source§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.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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 moreSource§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
impl<T> SerializableAny for T
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.