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