pub enum On {
Show 20 variants
MouseOver,
MouseDown,
LeftMouseDown,
MiddleMouseDown,
RightMouseDown,
MouseUp,
LeftMouseUp,
MiddleMouseUp,
RightMouseUp,
MouseEnter,
MouseLeave,
Scroll,
TextInput,
VirtualKeyDown,
VirtualKeyUp,
HoveredFile,
DroppedFile,
HoveredFileCancelled,
FocusReceived,
FocusLost,
}
Expand description
When to call a callback action - On::MouseOver
, On::MouseOut
, etc.
Variants§
MouseOver
Mouse cursor is hovering over the element
MouseDown
Mouse cursor has is over element and is pressed
(not good for “click” events - use MouseUp
instead)
LeftMouseDown
(Specialization of MouseDown
). Fires only if the left mouse button
has been pressed while cursor was over the element
MiddleMouseDown
(Specialization of MouseDown
). Fires only if the middle mouse button
has been pressed while cursor was over the element
RightMouseDown
(Specialization of MouseDown
). Fires only if the right mouse button
has been pressed while cursor was over the element
MouseUp
Mouse button has been released while cursor was over the element
LeftMouseUp
(Specialization of MouseUp
). Fires only if the left mouse button has
been released while cursor was over the element
MiddleMouseUp
(Specialization of MouseUp
). Fires only if the middle mouse button has
been released while cursor was over the element
RightMouseUp
(Specialization of MouseUp
). Fires only if the right mouse button has
been released while cursor was over the element
MouseEnter
Mouse cursor has entered the element
MouseLeave
Mouse cursor has left the element
Scroll
Mousewheel / touchpad scrolling
TextInput
The window received a unicode character (also respects the system locale).
Check keyboard_state.current_char
to get the current pressed character.
VirtualKeyDown
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
A virtual keycode was release. See VirtualKeyDown
for more info.
HoveredFile
A file has been dropped on the element
DroppedFile
A file is being hovered on the element
HoveredFileCancelled
A file was hovered, but has exited the window
FocusReceived
Equivalent to onfocus
FocusLost
Equivalent to onblur
Trait Implementations§
Source§impl From<On> for EventFilter
impl From<On> for EventFilter
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 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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)