[][src]Enum azul_core::dom::EventFilter

pub enum EventFilter {
    Hover(HoverEventFilter),
    Not(NotEventFilter),
    Focus(FocusEventFilter),
    Window(WindowEventFilter),
}

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

Calls the attached callback when the mouse is actively over the given element.

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.

Calls the attached callback when the element is currently focused.

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]

Trait Implementations

impl Clone for EventFilter[src]

impl Copy for EventFilter[src]

impl Debug for EventFilter[src]

impl Eq for EventFilter[src]

impl From<On> for EventFilter[src]

impl Hash for EventFilter[src]

impl Ord for EventFilter[src]

impl PartialEq<EventFilter> for EventFilter[src]

impl PartialOrd<EventFilter> for EventFilter[src]

impl StructuralEq for EventFilter[src]

impl StructuralPartialEq for EventFilter[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.