[−][src]Enum azul_core::dom::EventFilter
Sets the target for what events can reach the callbacks specifically.
Filtering events can happen on several layers, depending on
if a DOM node is hovered over or actively focused. For example,
for text input, you wouldn't want to use hovering, because that
would mean that the user needs to hold the mouse over the text input
in order to enter text. To solve this, the DOM needs to fire events
for elements that are currently not part of the hit-test.
EventFilter
implements From<On>
as a shorthand (so that you can opt-in
to a more specific event) and use
Variants
Hover(HoverEventFilter)
Calls the attached callback when the mouse is actively over the given element.
Not(NotEventFilter)
Inverse of Hover
- calls the attached callback if the mouse is not
over the given element. This is particularly useful for popover menus
where you want to close the menu when the user clicks anywhere else but
the menu itself.
Focus(FocusEventFilter)
Calls the attached callback when the element is currently focused.
Window(WindowEventFilter)
Calls the callback when anything related to the window is happening.
The "hit item" will be the root item of the DOM.
For example, this can be useful for tracking the mouse position
(in relation to the window). In difference to Desktop
, this only
fires when the window is focused.
This can also be good for capturing controller input, touch input (i.e. global gestures that aren't attached to any component, but rather the "window" itself).
Implementations
impl EventFilter
[src]
pub fn as_hover_event_filter(&self) -> Option<HoverEventFilter>
[src]
pub fn as_focus_event_filter(&self) -> Option<FocusEventFilter>
[src]
pub fn as_not_event_filter(&self) -> Option<NotEventFilter>
[src]
pub fn as_window_event_filter(&self) -> Option<WindowEventFilter>
[src]
Trait Implementations
impl Clone for EventFilter
[src]
fn clone(&self) -> EventFilter
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for EventFilter
[src]
impl Debug for EventFilter
[src]
impl Eq for EventFilter
[src]
impl From<On> for EventFilter
[src]
fn from(input: On) -> EventFilter
[src]
impl Hash for EventFilter
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Ord for EventFilter
[src]
fn cmp(&self, other: &EventFilter) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<EventFilter> for EventFilter
[src]
fn eq(&self, other: &EventFilter) -> bool
[src]
fn ne(&self, other: &EventFilter) -> bool
[src]
impl PartialOrd<EventFilter> for EventFilter
[src]
fn partial_cmp(&self, other: &EventFilter) -> Option<Ordering>
[src]
fn lt(&self, other: &EventFilter) -> bool
[src]
fn le(&self, other: &EventFilter) -> bool
[src]
fn gt(&self, other: &EventFilter) -> bool
[src]
fn ge(&self, other: &EventFilter) -> bool
[src]
impl StructuralEq for EventFilter
[src]
impl StructuralPartialEq for EventFilter
[src]
Auto Trait Implementations
impl RefUnwindSafe for EventFilter
impl Send for EventFilter
impl Sync for EventFilter
impl Unpin for EventFilter
impl UnwindSafe for EventFilter
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,