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

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

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

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

FindPrev

Find previous

Bold

Make text bold

Italic

Make text italic

Underline

Underline text

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

Print document

NavNext

Navigate forwards one page/item

NavPrev

Navigate backwards one page/item

NavParent

Navigate to the parent item

May be used to browse “up” to a parent directory.

NavDown

Navigate “down”

This is an opposite to NavParent, and will mostly not be used.

TabNew

Open a new tab

TabNext

Navigate to next tab

TabPrev

Navigate to previous tab

Help

Show help

Rename

Rename

Refresh

Refresh

Spelling

Spell-check tool

Menu

Open the menu / activate the menubar

Fullscreen

Make view fullscreen

Close

Close window/tab/popup

Exit

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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Cast from Self to T

Try converting from Self to T

Cast to integer, truncating Read more

Cast to the nearest integer Read more

Cast the floor to an integer Read more

Cast the ceiling to an integer Read more

Try converting to integer with truncation Read more

Try converting to the nearest integer Read more

Try converting the floor to an integer Read more

Try convert the ceiling to an integer Read more

Convert from T to Self

Try converting from T to Self

Compare self to key and return true if they are equal.

Returns true if the given item matches this filter

Performs the conversion.

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.