class Crysterm::Event::KeyPress
- Crysterm::Event::KeyPress
- EventHandler::Event
- Reference
- Object
Overview
Individual key events emitted on specific key presses. This is used when
the caller does not want to listen for everything on Event::KeyPress
(i.e.
all keypresses), but when they want explicit keys like
Event::KeyPress::CtrlQ
.
Direct Known Subclasses
- Crysterm::Event::KeyPress::AltA
- Crysterm::Event::KeyPress::AltB
- Crysterm::Event::KeyPress::AltC
- Crysterm::Event::KeyPress::AltD
- Crysterm::Event::KeyPress::AltDown
- Crysterm::Event::KeyPress::AltE
- Crysterm::Event::KeyPress::AltEnter
- Crysterm::Event::KeyPress::AltF
- Crysterm::Event::KeyPress::AltG
- Crysterm::Event::KeyPress::AltH
- Crysterm::Event::KeyPress::AltI
- Crysterm::Event::KeyPress::AltJ
- Crysterm::Event::KeyPress::AltK
- Crysterm::Event::KeyPress::AltL
- Crysterm::Event::KeyPress::AltLeft
- Crysterm::Event::KeyPress::AltM
- Crysterm::Event::KeyPress::AltN
- Crysterm::Event::KeyPress::AltO
- Crysterm::Event::KeyPress::AltP
- Crysterm::Event::KeyPress::AltQ
- Crysterm::Event::KeyPress::AltR
- Crysterm::Event::KeyPress::AltRight
- Crysterm::Event::KeyPress::AltS
- Crysterm::Event::KeyPress::AltT
- Crysterm::Event::KeyPress::AltU
- Crysterm::Event::KeyPress::AltUp
- Crysterm::Event::KeyPress::AltV
- Crysterm::Event::KeyPress::AltW
- Crysterm::Event::KeyPress::AltX
- Crysterm::Event::KeyPress::AltY
- Crysterm::Event::KeyPress::AltZ
- Crysterm::Event::KeyPress::Backspace
- Crysterm::Event::KeyPress::CtrlA
- Crysterm::Event::KeyPress::CtrlB
- Crysterm::Event::KeyPress::CtrlC
- Crysterm::Event::KeyPress::CtrlD
- Crysterm::Event::KeyPress::CtrlDown
- Crysterm::Event::KeyPress::CtrlE
- Crysterm::Event::KeyPress::CtrlF
- Crysterm::Event::KeyPress::CtrlG
- Crysterm::Event::KeyPress::CtrlH
- Crysterm::Event::KeyPress::CtrlI
- Crysterm::Event::KeyPress::CtrlJ
- Crysterm::Event::KeyPress::CtrlK
- Crysterm::Event::KeyPress::CtrlL
- Crysterm::Event::KeyPress::CtrlLeft
- Crysterm::Event::KeyPress::CtrlM
- Crysterm::Event::KeyPress::CtrlN
- Crysterm::Event::KeyPress::CtrlO
- Crysterm::Event::KeyPress::CtrlP
- Crysterm::Event::KeyPress::CtrlQ
- Crysterm::Event::KeyPress::CtrlR
- Crysterm::Event::KeyPress::CtrlRight
- Crysterm::Event::KeyPress::CtrlS
- Crysterm::Event::KeyPress::CtrlT
- Crysterm::Event::KeyPress::CtrlU
- Crysterm::Event::KeyPress::CtrlUp
- Crysterm::Event::KeyPress::CtrlV
- Crysterm::Event::KeyPress::CtrlW
- Crysterm::Event::KeyPress::CtrlX
- Crysterm::Event::KeyPress::CtrlY
- Crysterm::Event::KeyPress::CtrlZ
- Crysterm::Event::KeyPress::Delete
- Crysterm::Event::KeyPress::Down
- Crysterm::Event::KeyPress::End
- Crysterm::Event::KeyPress::Enter
- Crysterm::Event::KeyPress::Escape
- Crysterm::Event::KeyPress::F1
- Crysterm::Event::KeyPress::F10
- Crysterm::Event::KeyPress::F11
- Crysterm::Event::KeyPress::F12
- Crysterm::Event::KeyPress::F2
- Crysterm::Event::KeyPress::F3
- Crysterm::Event::KeyPress::F4
- Crysterm::Event::KeyPress::F5
- Crysterm::Event::KeyPress::F6
- Crysterm::Event::KeyPress::F7
- Crysterm::Event::KeyPress::F8
- Crysterm::Event::KeyPress::F9
- Crysterm::Event::KeyPress::FixAutonumbering
- Crysterm::Event::KeyPress::Home
- Crysterm::Event::KeyPress::Insert
- Crysterm::Event::KeyPress::Left
- Crysterm::Event::KeyPress::Menu
- Crysterm::Event::KeyPress::PageDown
- Crysterm::Event::KeyPress::PageUp
- Crysterm::Event::KeyPress::Right
- Crysterm::Event::KeyPress::ShiftDown
- Crysterm::Event::KeyPress::ShiftLeft
- Crysterm::Event::KeyPress::ShiftRight
- Crysterm::Event::KeyPress::ShiftTab
- Crysterm::Event::KeyPress::ShiftUp
- Crysterm::Event::KeyPress::Space
- Crysterm::Event::KeyPress::Tab
- Crysterm::Event::KeyPress::Unknown
- Crysterm::Event::KeyPress::Up
Defined in:
event.crConstant Summary
-
KEYS =
{} of ::Tput::Key => self.class
-
This macro takes all enum members from Tput::Key and creates a
KeyPress::<member>
event for them, such asEvent::KeyPress::CtrlQ
.This is done as a convenience, so that users would not have to listen for all keypresses and then manually check for particular keys every time.
Constructors
Instance Method Summary
-
#accept
Accepts event and causes it to stop propagating.
- #accepted=(accepted : Bool)
- #accepted? : Bool
- #char : Char
- #char=(char : Char)
-
#ignore
Ignores event and causes it to continue propagating.
- #key : Tput::Key | Nil
- #key=(key : Tput::Key | Nil)
- #sequence : Array(Char)
- #sequence=(sequence : Array(Char))
Constructor Detail
def self.new(char : Char, key : Tput::Key | Nil = nil, sequence : Array(Char) = [char])
#