pub struct PointerCapture { /* private fields */ }Expand description
Optional application-owned pointer capture service, independent of winit.
Register once with Application::register_app_resource(Self::default()).
Frame systems use AppResMut<PointerCapture> to request lock on an explicit
user gesture and release it for menus. Desktop applies requests after the
logical frame; requesting capture does not promise backend support.
Focus loss clears the request immediately. Focus regain never reissues it.
Requests are immediate application-resource mutations, not transactional Commands. A headless runner preserves intent but performs no OS operation; deterministic tests may inject relative motion independently of OS status.
Implementations§
Source§impl PointerCapture
impl PointerCapture
Sourcepub fn request_lock(&mut self)
pub fn request_lock(&mut self)
Requests capture or explicitly retries an unavailable backend. Call on a fresh click/key gesture, not unconditionally every update. An already acknowledged capture needs no repeated backend operation.
Sourcepub fn release(&mut self)
pub fn release(&mut self)
Requests cursor release and visibility, normally when opening a menu. Repeating an acknowledged release performs no new backend operation.
Sourcepub const fn requested(&self) -> bool
pub const fn requested(&self) -> bool
Returns current application intent, not actual OS capture availability.
Sourcepub const fn status(&self) -> PointerCaptureStatus
pub const fn status(&self) -> PointerCaptureStatus
Returns the latest acknowledged backend state.
Sourcepub const fn is_captured(&self) -> bool
pub const fn is_captured(&self) -> bool
Reports successful locked/confined capture, not merely a request.
Trait Implementations§
Source§impl Debug for PointerCapture
impl Debug for PointerCapture
Auto Trait Implementations§
impl Freeze for PointerCapture
impl RefUnwindSafe for PointerCapture
impl Send for PointerCapture
impl Sync for PointerCapture
impl Unpin for PointerCapture
impl UnsafeUnpin for PointerCapture
impl UnwindSafe for PointerCapture
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
impl<T> ConditionalSend for Twhere
T: Send,
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<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
Source§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Creates Self using default().