Struct zng_ext_input::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) -> ReadOnlyArcVar<Option<CaptureInfo>>
pub fn current_capture(&self) -> ReadOnlyArcVar<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> 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> 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