Enum kas::event::Command [−][src]
pub enum Command {
Show 59 variants
Escape,
Return,
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,
FindPrev,
Bold,
Italic,
Underline,
Link,
Cut,
Copy,
Paste,
Undo,
Redo,
New,
Open,
Save,
Print,
NavNext,
NavPrev,
NavParent,
NavDown,
TabNew,
TabNext,
TabPrev,
Help,
Rename,
Refresh,
Spelling,
Menu,
Fullscreen,
Close,
Exit,
}
Expand description
Command input (Event::Command
)
The exact command sent depends on the type of focus a widget has.
Handling may depend on the state of the Shift key.
The exact mapping between the keyboard and these commands is OS-specific.
In the future it should be customisable (see shortcuts
module).
Variants
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 Response::Unhandled
.
This is in some cases remapped to Command::Deselect
.
Return / enter key
This may insert a line-break or may activate something.
This is only sent to widgets with char focus.
In other cases a widget may receive Event::Activate
.
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.
Move view up without affecting selection
Move view down without affecting selection
Move left
Move right
Move up
Move down
Move left one word
Move right one word
Move to start (of the line)
Move to end (of the line)
Move to start of the document
Move to end of the document
Move up a page
Move down a page
Capture a screenshot
Lock output of screen
Pause key
Insert key
Delete forwards
Delete backwards (Backspace key)
Delete forwards one word
Delete backwards one word
Clear any selections
Select all contents
Find (start)
Find and replace (start)
Find next
Find previous
Make text bold
Make text italic
Underline text
Insert a link
Copy to clipboard and clear
Copy to clipboard
Copy from clipboard
Undo the last action
Redo the last undone action
New document
Open document
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.
Open a new tab
Navigate to next tab
Navigate to previous tab
Show help
Rename
Refresh
Spell-check tool
Open the menu / activate the menubar
Make view fullscreen
Close window/tab/popup
Exit program (e.g. Ctrl+Q)
Implementations
Try constructing from a VirtualKeyCode
Convert to selection-focus command
Certain limited commands may be sent to widgets with selection focus but not character or navigation focus.
Trait Implementations
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<Command, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<Command, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations
impl RefUnwindSafe for Command
impl UnwindSafe for Command
Blanket Implementations
Mutably borrows from an owned value. Read more
impl<T> CallHasher for T where
T: Hash,
impl<T> CallHasher for T where
T: Hash,
pub fn cast_trunc(self) -> T
pub fn cast_trunc(self) -> T
Cast to integer, truncating Read more
pub fn cast_nearest(self) -> T
pub fn cast_nearest(self) -> T
Cast to the nearest integer Read more
pub fn cast_floor(self) -> T
pub fn cast_floor(self) -> T
Cast the floor to an integer Read more
pub fn try_cast_trunc(self) -> Result<T, Error>
pub fn try_cast_trunc(self) -> Result<T, Error>
Try converting to integer with truncation Read more
pub fn try_cast_nearest(self) -> Result<T, Error>
pub fn try_cast_nearest(self) -> Result<T, Error>
Try converting to the nearest integer Read more
pub fn try_cast_floor(self) -> Result<T, Error>
pub fn try_cast_floor(self) -> Result<T, Error>
Try converting the floor to an integer Read more
pub fn try_cast_ceil(self) -> Result<T, Error>
pub fn try_cast_ceil(self) -> Result<T, Error>
Try convert the ceiling to an integer Read more
Compare self to key
and return true
if they are equal.