Sign in

    moonbit-community/tty/input does not have a README file

    InputEvent

    pub(all) enum InputEvent {
    Key(KeyEvent)
    Mouse(MouseEvent)
    Paste(String)
    FocusIn
    FocusOut
    Unknown(Bytes)
    } derive(Eq,
    Debug
    )

    User input decoded from terminal bytes.

    Unsupported, malformed, invalid UTF-8, or unclosed sequences are preserved as Unknown bytes instead of becoming decoder errors.

    InputEvent::equal

    fn InputEvent::equal(InputEvent, InputEvent) -> Bool

    InputEvent::not_equal

    fn InputEvent::not_equal(x : InputEvent, y : InputEvent) -> Bool

    KeyCode

    pub(all) enum KeyCode {
    Char(Char)
    Text
    Enter
    Tab
    Backspace
    Delete
    Escape
    Up
    Down
    Left
    Right
    Home
    End
    PageUp
    PageDown
    Insert
    F1
    F2
    F3
    F4
    F5
    F6
    F7
    F8
    F9
    F10
    F11
    F12
    F13
    F14
    F15
    F16
    F17
    F18
    F19
    F20
    F21
    F22
    F23
    F24
    F25
    F26
    F27
    F28
    F29
    F30
    F31
    F32
    F33
    F34
    F35
    CapsLock
    ScrollLock
    NumLock
    PrintScreen
    Pause
    Menu
    KeypadBegin
    Keypad0
    Keypad1
    Keypad2
    Keypad3
    Keypad4
    Keypad5
    Keypad6
    Keypad7
    Keypad8
    Keypad9
    KeypadDecimal
    KeypadDivide
    KeypadMultiply
    KeypadMinus
    KeypadPlus
    KeypadEnter
    KeypadEqual
    KeypadSeparator
    Media(MediaKeyCode)
    Modifier(ModifierKeyCode)
    } derive(Eq,
    Debug
    )

    Logical key code decoded from terminal input.

    KeyCode::equal

    fn KeyCode::equal(KeyCode, KeyCode) -> Bool

    KeyCode::not_equal

    fn KeyCode::not_equal(x : KeyCode, y : KeyCode) -> Bool

    KeyCode::to_repr

    KeyEvent

    pub struct KeyEvent {
    code : KeyCode
    modifiers : KeyModifiers
    kind : KeyEventKind
    state : KeyEventState
    text : String?
    shifted_code : KeyCode?
    base_code : KeyCode?
    } derive(Eq,
    Debug
    )

    Decoded key event.

    text is decoded terminal text when present. It is not a grapheme, display width, or cursor-motion contract.

    shifted_code and base_code are available when kitty keyboard protocol alternate key reports are enabled. shifted_code is the shifted key in the active layout; base_code is the key in a standard PC-101 layout.

    KeyEvent::equal

    fn KeyEvent::equal(KeyEvent, KeyEvent) -> Bool

    KeyEvent::new

    fn KeyEvent::new(code : KeyCode, modifiers? : KeyModifiers, text? : String, kind? : KeyEventKind, state? : KeyEventState, shifted_code? : KeyCode, base_code? : KeyCode) -> KeyEvent

    Construct a key event.

    KeyEvent::not_equal

    fn KeyEvent::not_equal(x : KeyEvent, y : KeyEvent) -> Bool

    KeyEvent::to_repr

    KeyEventKind

    pub(all) enum KeyEventKind {
    Press
    Repeat
    Release
    } derive(Eq,
    Debug
    )

    Keyboard event action.

    KeyEventKind::equal

    KeyEventKind::not_equal

    fn KeyEventKind::not_equal(x : KeyEventKind, y : KeyEventKind) -> Bool

    KeyEventState

    type KeyEventState derive(Eq,
    Debug
    )

    Opaque set of keyboard event state flags.

    KeyEventState::caps_lock

    fn KeyEventState::caps_lock(self : KeyEventState) -> Bool

    Return whether Caps Lock was active for the key event.

    KeyEventState::equal

    KeyEventState::keypad

    fn KeyEventState::keypad(self : KeyEventState) -> Bool

    Return whether the event originated from the keypad.

    KeyEventState::new

    fn KeyEventState::new(keypad? : Bool, caps_lock? : Bool, num_lock? : Bool) -> KeyEventState

    Construct a keyboard event state set.

    KeyEventState::not_equal

    fn KeyEventState::not_equal(x : KeyEventState, y : KeyEventState) -> Bool

    KeyEventState::num_lock

    fn KeyEventState::num_lock(self : KeyEventState) -> Bool

    Return whether Num Lock was active for the key event.

    KeyModifiers

    type KeyModifiers derive(Eq,
    Debug
    )

    Opaque set of key modifiers.

    KeyModifiers::alt

    fn KeyModifiers::alt(self : KeyModifiers) -> Bool

    Return whether the Alt modifier is set.

    KeyModifiers::ctrl

    fn KeyModifiers::ctrl(self : KeyModifiers) -> Bool

    Return whether the Ctrl modifier is set.

    KeyModifiers::equal

    KeyModifiers::hyper

    fn KeyModifiers::hyper(self : KeyModifiers) -> Bool

    Return whether the Hyper modifier is set.

    KeyModifiers::meta

    fn KeyModifiers::meta(self : KeyModifiers) -> Bool

    Return whether the Meta modifier is set.

    KeyModifiers::new

    fn KeyModifiers::new(shift? : Bool, alt? : Bool, ctrl? : Bool, meta? : Bool, super_? : Bool, hyper? : Bool) -> KeyModifiers

    Construct a modifier set.

    KeyModifiers::not_equal

    fn KeyModifiers::not_equal(x : KeyModifiers, y : KeyModifiers) -> Bool

    KeyModifiers::shift

    fn KeyModifiers::shift(self : KeyModifiers) -> Bool

    Return whether the Shift modifier is set.

    KeyModifiers::super_

    fn KeyModifiers::super_(self : KeyModifiers) -> Bool

    Return whether the Super modifier is set.

    MediaKeyCode

    pub(all) enum MediaKeyCode {
    Play
    Pause
    PlayPause
    Reverse
    Stop
    FastForward
    Rewind
    TrackNext
    TrackPrevious
    Record
    LowerVolume
    RaiseVolume
    MuteVolume
    } derive(Eq,
    Debug
    )

    Media key decoded from kitty keyboard functional key reports.

    MediaKeyCode::equal

    MediaKeyCode::not_equal

    fn MediaKeyCode::not_equal(x : MediaKeyCode, y : MediaKeyCode) -> Bool

    ModifierKeyCode

    pub(all) enum ModifierKeyCode {
    LeftShift
    LeftControl
    LeftAlt
    LeftSuper
    LeftHyper
    LeftMeta
    RightShift
    RightControl
    RightAlt
    RightSuper
    RightHyper
    RightMeta
    IsoLevel3Shift
    IsoLevel5Shift
    } derive(Eq,
    Debug
    )

    Modifier key decoded from kitty keyboard functional key reports.

    ModifierKeyCode::equal

    ModifierKeyCode::not_equal

    fn ModifierKeyCode::not_equal(x : ModifierKeyCode, y : ModifierKeyCode) -> Bool

    MouseButton

    pub(all) enum MouseButton {
    Left
    Middle
    Right
    } derive(Eq,
    Debug
    )

    Supported mouse buttons.

    MouseButton::equal

    fn MouseButton::equal(MouseButton, MouseButton) -> Bool

    MouseButton::not_equal

    fn MouseButton::not_equal(x : MouseButton, y : MouseButton) -> Bool

    MouseEvent

    pub struct MouseEvent {
    kind : MouseEventKind
    row : Int
    col : Int
    modifiers : KeyModifiers
    } derive(Eq,
    Debug
    )

    Decoded mouse event.

    Rows and columns are 1-based terminal cell coordinates.

    MouseEvent::equal

    fn MouseEvent::equal(MouseEvent, MouseEvent) -> Bool

    MouseEvent::new

    fn MouseEvent::new(kind : MouseEventKind, row : Int, col : Int, modifiers? : KeyModifiers) -> MouseEvent

    Construct a mouse event with optional key modifiers.

    MouseEvent::not_equal

    fn MouseEvent::not_equal(x : MouseEvent, y : MouseEvent) -> Bool

    MouseEventKind

    pub(all) enum MouseEventKind {
    Press(MouseButton)
    Release(MouseButton)
    Drag(MouseButton)
    Move
    Scroll(MouseScroll)
    } derive(Eq,
    Debug
    )

    Mouse input action decoded from an SGR mouse report.

    MouseEventKind::equal

    MouseEventKind::not_equal

    fn MouseEventKind::not_equal(x : MouseEventKind, y : MouseEventKind) -> Bool

    MouseScroll

    pub(all) enum MouseScroll {
    Up
    Down
    Left
    Right
    } derive(Eq,
    Debug
    )

    Supported mouse scroll directions.

    MouseScroll::equal

    fn MouseScroll::equal(MouseScroll, MouseScroll) -> Bool

    MouseScroll::not_equal

    fn MouseScroll::not_equal(x : MouseScroll, y : MouseScroll) -> Bool

    Source Files

    Powered by MoonBit

    Site sourceReport issuePackagesBuild queueSkillsStatistics

    © 2026 mooncakes.io