#[non_exhaustive]pub enum ContextMenuTrigger {
Pointer,
Keyboard,
Accessibility,
}Expand description
What asked for a context menu, as a ContextMenuFactory reads it from
EventContext::context_menu_trigger.
A factory is handed a point whatever opened the menu, and only a pointer’s point is one the user chose. For the keyboard and for assistive technology the point is where the menu is drawn: a factory that treated it as a click moved the caret of a text field to the middle of the field, and the menu’s Paste then wrote where the user had never been.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Pointer
A secondary click, or a hold with a finger or a pen: the point is where the user pointed.
Keyboard
The Menu key, Shift+F10, or on macOS Ctrl+Shift+M, on the focused widget.
Accessibility
An assistive technology’s
ShowContextMenu action.
Implementations§
Source§impl ContextMenuTrigger
impl ContextMenuTrigger
Sourcepub const fn is_pointer(self) -> bool
pub const fn is_pointer(self) -> bool
Whether the factory’s point is one the user pointed at.
Trait Implementations§
Source§impl Clone for ContextMenuTrigger
impl Clone for ContextMenuTrigger
impl Copy for ContextMenuTrigger
Source§impl Debug for ContextMenuTrigger
impl Debug for ContextMenuTrigger
impl Eq for ContextMenuTrigger
Source§impl PartialEq for ContextMenuTrigger
impl PartialEq for ContextMenuTrigger
impl StructuralPartialEq for ContextMenuTrigger
Auto Trait Implementations§
impl Freeze for ContextMenuTrigger
impl RefUnwindSafe for ContextMenuTrigger
impl Send for ContextMenuTrigger
impl Sync for ContextMenuTrigger
impl Unpin for ContextMenuTrigger
impl UnsafeUnpin for ContextMenuTrigger
impl UnwindSafe for ContextMenuTrigger
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
Mutably borrows from an owned value. Read more