Struct zng::pointer_capture::POINTER_CAPTURE
source · pub struct POINTER_CAPTURE;
Expand description
Mouse and touch capture service.
Mouse and touch is captured when mouse and touch events are redirected to a specific target. The user can still move the cursor or touch contact outside of the target but the widgets outside do not react to this.
You can request capture by calling capture_widget
or
capture_subtree
with a widget that was pressed by a mouse button or by touch.
The capture will last for as long as any of the mouse buttons or touch contacts are pressed, the widget is visible
and the window is focused.
Windows capture by default, this cannot be disabled. For other widgets this is optional.
§Provider
This service is provided by the PointerCaptureManager
extension.
Implementations§
source§impl POINTER_CAPTURE
impl POINTER_CAPTURE
sourcepub fn current_capture(
&self,
) -> ReadOnlyVar<Option<CaptureInfo>, ArcVar<Option<CaptureInfo>>>
pub fn current_capture( &self, ) -> ReadOnlyVar<Option<CaptureInfo>, ArcVar<Option<CaptureInfo>>>
Variable that gets the current capture target and mode.
sourcepub fn capture_widget(&self, widget_id: WidgetId)
pub fn capture_widget(&self, widget_id: WidgetId)
Set a widget to redirect all mouse and touch events to.
The capture will be set only if the widget is pressed.
sourcepub fn capture_subtree(&self, widget_id: WidgetId)
pub fn capture_subtree(&self, widget_id: WidgetId)
Set a widget to be the root of a capture subtree.
Mouse and touch events targeting inside the subtree go to target normally. Mouse and touch events outside the capture root are redirected to the capture root.
The capture will be set only if the widget is pressed.
sourcepub fn release_capture(&self)
pub fn release_capture(&self)
Release the current mouse and touch capture back to window.
Note: The capture is released automatically when the mouse buttons or touch are released or when the window loses focus.
Auto Trait Implementations§
impl Freeze for POINTER_CAPTURE
impl RefUnwindSafe for POINTER_CAPTURE
impl Send for POINTER_CAPTURE
impl Sync for POINTER_CAPTURE
impl Unpin for POINTER_CAPTURE
impl UnwindSafe for POINTER_CAPTURE
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<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§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
.§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
.§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.§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.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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