germinal/types
A module containing types in germinal.
Types
Represent any event in terminal.
Currently, this library does not support mouse.
pub type Event {
FocusGained
FocusLost
Key(KeyEvent)
Paste(String)
Resize(Int, Int)
}
Constructors
-
FocusGained -
FocusLost -
Key(KeyEvent) -
Paste(String) -
Resize(Int, Int)
Key code.
pub type KeyCode {
Backspace
Enter
Left
Right
Up
Down
Home
End
PageUp
PageDown
Tab
BackTab
Delete
Insert
F(Int)
Char(String)
Null
Esc
CapsLock
ScrollLock
NumLock
PrintScreen
Pause
Menu
KeypadBegin
}
Constructors
-
Backspace -
Enter -
Left -
Right -
Up -
Down -
Home -
End -
PageUp -
PageDown -
Tab -
BackTab -
Delete -
Insert -
F(Int) -
Char(String) -
Null -
Esc -
CapsLock -
ScrollLock -
NumLock -
PrintScreen -
Pause -
Menu -
KeypadBegin
The kind of key event.
pub type KeyEventKind {
Press
Repeat
Release
}
Constructors
-
Press -
Repeat -
Release
The state of key event.
pub type KeyEventState
pub type KeyModifiers
Functions
pub fn contains_modifiers(
parent_modifiers: KeyModifiers,
child_modifiers: KeyModifiers,
) -> Bool
Return True if parent_modifiers contains child_modifiers. Return False if not.
pub fn contains_state(
parent_state: KeyEventState,
child_state: KeyEventState,
) -> Bool
Return True if parent_state contains child_state. Return False if not.
pub fn control_modifier() -> KeyModifiers
pub fn get_key_modifiers(event: KeyEvent) -> KeyModifiers
Return the key modifiers of the key event.
pub fn get_keycode(event: KeyEvent) -> KeyCode
Return the key code of the key event.
pub fn get_keyevent_kind(event: KeyEvent) -> KeyEventKind
Return the kind of the key event.
pub fn get_keyevent_state(event: KeyEvent) -> KeyEventState
Return the state of the key event.
pub fn or_modifiers(
modifiers1: KeyModifiers,
modifiers2: KeyModifiers,
) -> KeyModifiers
Combine two modifiers.
pub fn or_state(
state1: KeyEventState,
state2: KeyEventState,
) -> KeyEventState
Combine two state.