#[repr(C)]pub enum On {
Show 25 variants
MouseOver = 0,
MouseDown = 1,
LeftMouseDown = 2,
MiddleMouseDown = 3,
RightMouseDown = 4,
MouseUp = 5,
LeftMouseUp = 6,
MiddleMouseUp = 7,
RightMouseUp = 8,
MouseEnter = 9,
MouseLeave = 10,
Scroll = 11,
TextInput = 12,
VirtualKeyDown = 13,
VirtualKeyUp = 14,
HoveredFile = 15,
DroppedFile = 16,
HoveredFileCancelled = 17,
FocusReceived = 18,
FocusLost = 19,
Default = 20,
Collapse = 21,
Expand = 22,
Increment = 23,
Decrement = 24,
}Expand description
Defines the type of event that can trigger a callback action.
Variants§
MouseOver = 0
Mouse cursor is hovering over the element.
MouseDown = 1
Mouse cursor has is over element and is pressed
(not good for “click” events - use MouseUp instead).
LeftMouseDown = 2
(Specialization of MouseDown). Fires only if the left mouse button
has been pressed while cursor was over the element.
MiddleMouseDown = 3
(Specialization of MouseDown). Fires only if the middle mouse button
has been pressed while cursor was over the element.
RightMouseDown = 4
(Specialization of MouseDown). Fires only if the right mouse button
has been pressed while cursor was over the element.
MouseUp = 5
Mouse button has been released while cursor was over the element.
LeftMouseUp = 6
(Specialization of MouseUp). Fires only if the left mouse button has
been released while cursor was over the element.
MiddleMouseUp = 7
(Specialization of MouseUp). Fires only if the middle mouse button has
been released while cursor was over the element.
RightMouseUp = 8
(Specialization of MouseUp). Fires only if the right mouse button has
been released while cursor was over the element.
MouseEnter = 9
Mouse cursor has entered the element.
MouseLeave = 10
Mouse cursor has left the element.
Scroll = 11
Mousewheel / touchpad scrolling.
TextInput = 12
The window received a unicode character (also respects the system locale).
Check keyboard_state.current_char to get the current pressed character.
VirtualKeyDown = 13
A virtual keycode was pressed. Note: This is only the virtual keycode,
not the actual char. If you want to get the character, use TextInput instead.
A virtual key does not have to map to a printable character.
You can get all currently pressed virtual keycodes in the
keyboard_state.current_virtual_keycodes and / or just the last keycode in the
keyboard_state.latest_virtual_keycode.
VirtualKeyUp = 14
A virtual keycode was release. See VirtualKeyDown for more info.
HoveredFile = 15
A file has been dropped on the element.
DroppedFile = 16
A file is being hovered on the element.
HoveredFileCancelled = 17
A file was hovered, but has exited the window.
FocusReceived = 18
Equivalent to onfocus.
FocusLost = 19
Equivalent to onblur.
Default = 20
Default action triggered by screen reader (usually same as click/activate)
Collapse = 21
Element should collapse (e.g., accordion panel, tree node)
Expand = 22
Element should expand (e.g., accordion panel, tree node)
Increment = 23
Increment value (e.g., number input, slider)
Decrement = 24
Decrement value (e.g., number input, slider)
Trait Implementations§
Source§impl From<On> for EventFilter
Convert from On enum to EventFilter.
impl From<On> for EventFilter
Convert from On enum to EventFilter.
This determines which specific filter variant is used based on the event type.
For example, On::TextInput becomes a Focus event filter, while On::VirtualKeyDown
becomes a Window event filter (since it’s global to the window).
Source§fn from(input: On) -> EventFilter
fn from(input: On) -> EventFilter
Source§impl Ord for On
impl Ord for On
Source§impl PartialOrd for On
impl PartialOrd for On
impl Copy for On
impl Eq for On
impl StructuralPartialEq for On
Auto Trait Implementations§
impl Freeze for On
impl RefUnwindSafe for On
impl Send for On
impl Sync for On
impl Unpin for On
impl UnsafeUnpin for On
impl UnwindSafe for On
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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