Skip to content
FutureBlitz

    Install

    Import std.term.input

    KeyEvent

    std.term.input

    struct

    Public Struct KeyEvent Implements Hashable, Printable

    A key typed: its Code, the Character it typed for CHAR, and the Modifiers held with it. A letter typed with Ctrl is that letter, lowercase, with CONTROL, so Ctrl+C is 'c' and CONTROL, and Ctrl+Space is ' ' and CONTROL. A capital is its own Character, without SHIFT, as a terminal sends it.

    std/term/input.fb, line 99

    • Public ReadOnly Field Code: KeyCode field #

      Which key it was.

    • Public ReadOnly Field Character: Char field #

      The character it typed, for CHAR.

    • Public ReadOnly Field Modifiers: KeyModifiers field #

      The modifiers held with it.

    • Public New(code: KeyCode, modifiers: KeyModifiers = KeyModifiers.NONE) constructor #

      A key that types no character, like UP, with the modifiers held.

    • Public New(character: Char, modifiers: KeyModifiers = KeyModifiers.NONE) constructor #

      The key that types character, with the modifiers held.

    • Public Method IsChar(c: Char): Bool method #

      Whether it typed c, without Ctrl or Alt.

    • Public Method IsControl(c: Char): Bool method #

      Whether it's Ctrl and the letter c, in either case, without Alt: IsControl('c') for Ctrl+C.

    • Public Property IsText: Bool property #

      Whether it types a character that shows, without Ctrl or Alt, as text takes it.

    • Public Method ToString(): String method #

      Like "a", "Ctrl+C", "Alt+Enter", "Shift+Up", "F5", or "Space".

    Report an issue with this page or with FutureBlitz on GitHub.