[][src]Enum kas::event::ControlKey

pub enum ControlKey {
    Escape,
    Return,
    Tab,
    Left,
    Right,
    Up,
    Down,
    Home,
    End,
    PageUp,
    PageDown,
    Snapshot,
    ScrollLock,
    Pause,
    Insert,
    Delete,
    Backspace,
    Deselect,
    SelectAll,
    Cut,
    Copy,
    Paste,
    Undo,
    Redo,
    Backward,
    Forward,
}

Control / Navigation key (Event::Control)

These codes are generated from keyboard events when a widget has char or nav focus. The codes generated differ slightly depending on which focus dominates; see notes on ControlKey::Return and ControlKey::Tab.

In some cases, a widget's response will depend on the state of modifier keys. This state can be read via the Manager::modifiers method.

The purpose of this enum (instead of sending the active widget a VirtualKeyCode) is consistent behaviour: these "navigation keys" will always be sent to the widget highlighted for keyboard navigation, if active, while alpha-numeric keys will always be available for accelerator keys (when a character input grab is not present). Additionally, this allows uniform behaviour with regards to num-pad keys.

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.

Return

Line break (return / enter key)

Note: this is generated only when a widget has char focus (see Manager::request_char_focus), otherwise the Return key is mapped to Event::Activate and sent to the widget with nav focus.

Tab

(Horizontal) tabulation

Note: this is generated only when a widget has char focus (see Manager::request_char_focus), otherwise the Tab key adjusts nav focus.

Left

Left arrow

Right

Right arrow

Up

Up arrow

Down

Down arrow

Home

Home key

End

End key

PageUp

Page up

PageDown

Page down

Snapshot

"Screenshot" key

ScrollLock

Scroll lock key

Pause

Pause key

Insert

Insert key

Delete

Delete forwards

Backspace

Delete backwards

Deselect

Clear any selections

SelectAll

Select all contents

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

Backward

Navigate backwards one page/item

Forward

Navigate forwards one page/item

Implementations

impl ControlKey[src]

pub fn new(vkey: VirtualKeyCode) -> Option<Self>[src]

Try constructing from a VirtualKeyCode

Trait Implementations

impl Clone for ControlKey[src]

impl Copy for ControlKey[src]

impl Debug for ControlKey[src]

impl Eq for ControlKey[src]

impl Hash for ControlKey[src]

impl PartialEq<ControlKey> for ControlKey[src]

impl StructuralEq for ControlKey[src]

impl StructuralPartialEq for ControlKey[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.