#[non_exhaustive]pub enum Command {
Show 63 variants
Escape,
Activate,
Enter,
Space,
Tab,
ViewUp,
ViewDown,
Left,
Right,
Up,
Down,
WordLeft,
WordRight,
Home,
End,
DocHome,
DocEnd,
PageUp,
PageDown,
Snapshot,
ScrollLock,
Pause,
Insert,
Delete,
DelBack,
DelWord,
DelWordBack,
Deselect,
SelectAll,
Find,
FindReplace,
FindNext,
FindPrevious,
Bold,
Italic,
Underline,
Link,
Cut,
Copy,
Paste,
Undo,
Redo,
New,
Open,
Save,
Print,
NavNext,
NavPrevious,
NavParent,
NavDown,
TabNew,
TabNext,
TabPrevious,
Help,
Rename,
Refresh,
Debug,
SpellCheck,
ContextMenu,
Menu,
Fullscreen,
Close,
Exit,
}
Expand description
Command input (Event::Command
)
Command
events are mostly produced as a result of OS-specific keyboard
bindings; for example, Command::Copy
is produced by pressing
Command+C on MacOS or Ctrl+C on other platforms.
See crate::event::config::Shortcuts
for more on these bindings.
A Command
event does not necessarily come from keyboard input; for example
some menu widgets send Command::Activate
to trigger an entry as a result
of mouse input.
Most Command
entries represent an action (such as Copy
or FindNext
)
but some represent an important key whose action may be context-dependent
(e.g. Escape
, Space
).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Escape
Escape key
Each press of this key should somehow relax control. It is expected that
widgets receiving this key repeatedly eventually (soon) have no more
use for this themselves and return it via Unused
.
This is in some cases remapped to Command::Deselect
.
Activate
Programmatic activation
A synthetic event to activate widgets. Consider matching
Command::is_activate
or using using Event::on_activate
instead for generally applicable activation.
Enter
Return / enter key
This may insert a line-break or may activate something.
Space
Space bar key
Tab
Tab key
This key is used to insert (horizontal) tabulators as well as to navigate focus (in reverse when combined with Shift).
This is usually not sent to widgets but instead used for navigation.
ViewUp
Move view up without affecting selection
ViewDown
Move view down without affecting selection
Left
Move left
Right
Move right
Up
Move up
Down
Move down
WordLeft
Move left one word
WordRight
Move right one word
Home
Move to start (of the line)
End
Move to end (of the line)
DocHome
Move to start of the document
DocEnd
Move to end of the document
PageUp
Move up a page
PageDown
Move down a page
Snapshot
Capture a screenshot
ScrollLock
Lock output of screen
Pause
Pause key
Insert
Insert key
Delete
Delete forwards
DelBack
Delete backwards (Backspace key)
DelWord
Delete forwards one word
DelWordBack
Delete backwards one word
Deselect
Clear any selections
SelectAll
Select all contents
Find
Find (start)
FindReplace
Find and replace (start)
FindNext
Find next
FindPrevious
Find previous
Bold
Make text bold
Italic
Make text italic
Underline
Underline text
Link
Insert a link
Cut
Copy to clipboard and clear
Copy
Copy to clipboard
Paste
Copy from clipboard
Undo
Undo the last action
Redo
Redo the last undone action
New
New document
Open
Open document
Save
Save document
Print document
Navigate forwards one page/item
Navigate backwards one page/item
Navigate to the parent item
May be used to browse “up” to a parent directory.
Navigate “down”
This is an opposite to NavParent
, and will mostly not be used.
TabNew
Open a new tab
TabNext
Navigate to next tab
TabPrevious
Navigate to previous tab
Help
Show help
Rename
Rename
Refresh
Refresh
Debug
Debug
SpellCheck
Spell-check tool
ContextMenu
Open the context menu
Menu
Open or activate the application menu / menubar
Fullscreen
Make view fullscreen
Close
Close window/tab/popup
Exit
Exit program (e.g. Ctrl+Q)
Implementations§
source§impl Command
impl Command
sourcepub fn is_activate(self) -> bool
pub fn is_activate(self) -> bool
True for “activation” commands
This matches:
Self::Activate
— programmatic activationSelf::Enter
— Enter and Return keysSelf::Space
— Space key
sourcepub fn suitable_for_sel_focus(self) -> bool
pub fn suitable_for_sel_focus(self) -> bool
Convert to selection-focus command
Certain limited commands may be sent to widgets with selection focus but not character or navigation focus.
sourcepub fn as_direction(self) -> Option<Direction>
pub fn as_direction(self) -> Option<Direction>
Convert arrow keys to a direction
Trait Implementations§
source§impl Ord for Command
impl Ord for Command
source§impl PartialEq for Command
impl PartialEq for Command
source§impl PartialOrd for Command
impl PartialOrd for Command
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moreimpl Copy for Command
impl Eq for Command
impl StructuralEq for Command
impl StructuralPartialEq for Command
Auto Trait Implementations§
impl RefUnwindSafe for Command
impl Send for Command
impl Sync for Command
impl Unpin for Command
impl UnwindSafe for Command
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
§impl<S, T> CastApprox<T> for Swhere
T: ConvApprox<S>,
impl<S, T> CastApprox<T> for Swhere
T: ConvApprox<S>,
§fn try_cast_approx(self) -> Result<T, Error>
fn try_cast_approx(self) -> Result<T, Error>
§fn cast_approx(self) -> T
fn cast_approx(self) -> T
§impl<S, T> CastFloat<T> for Swhere
T: ConvFloat<S>,
impl<S, T> CastFloat<T> for Swhere
T: ConvFloat<S>,
§fn cast_trunc(self) -> T
fn cast_trunc(self) -> T
§fn cast_nearest(self) -> T
fn cast_nearest(self) -> T
§fn cast_floor(self) -> T
fn cast_floor(self) -> T
§fn try_cast_trunc(self) -> Result<T, Error>
fn try_cast_trunc(self) -> Result<T, Error>
§fn try_cast_nearest(self) -> Result<T, Error>
fn try_cast_nearest(self) -> Result<T, Error>
§fn try_cast_floor(self) -> Result<T, Error>
fn try_cast_floor(self) -> Result<T, Error>
§fn try_cast_ceil(self) -> Result<T, Error>
fn try_cast_ceil(self) -> Result<T, Error>
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.