qezz / zee

Opinionated fork of https://github.com/zee-editor/zee
Apache License 2.0
0 stars 0 forks source link

More key combinations #9

Open qezz opened 2 months ago

qezz commented 2 months ago
qezz commented 1 month ago

M-<backspace> etc. is currently not possible due to the upstream implementation of zee's TUI library -- zi

/// Input event
#[derive(Debug)]
pub enum Event {
    KeyPress(Key),
}

/// Keyboard input. It aims to match what a terminal supports.
#[derive(Debug, Clone, Copy, PartialOrd, PartialEq, Eq, Hash)]
pub enum Key {
    /// Backspace.
    Backspace,
    /// Left arrow.
    Left,
    /// Right arrow.
    Right,
    /// Up arrow.
    Up,
    /// Down arrow.
    Down,
    /// Home key.
    Home,
    /// End key.
    End,
    /// Page Up key.
    PageUp,
    /// Page Down key.
    PageDown,
    /// Backward Tab key.
    BackTab,
    /// Delete key.
    Delete,
    /// Insert key.
    Insert,
    /// Function keys.
    ///
    /// Only function keys 1 through 12 are supported.
    F(u8),
    /// Normal character.
    Char(char),
    /// Alt modified character.
    Alt(char),
    /// Ctrl modified character.
    ///
    /// Note that certain keys may not be modifiable with `ctrl`, due to limitations of terminals.
    Ctrl(char),
    /// Null byte.
    Null,
    /// Esc key.
    Esc,
}