type MediaKeyCode = [
`Play,
`Pause,
`PlayPause,
`Reverse,
`Stop,
`FastForward,
`Rewind,
`TrackNext,
`TrackPrevious,
`Record,
`LowerVolume,
`RaiseVolume,
`MuteVolume
];
type ModifierKeyCode = [
`LeftShift,
`LeftControl,
`LeftAlt,
`LeftSuper,
`LeftHyper,
`LeftMeta,
`RightShift,
`RightControl,
`RightAlt,
`RightSuper,
`RightHyper,
`RightMeta,
`IsoLevel3Shift,
`IsoLevel5Shift
];
type KeyCode = [
`Backspace,
`Enter,
`Left,
`Right,
`Up,
`Down,
`Home,
`End,
`PageUp,
`PageDown,
`Tab,
`BackTab,
`Delete,
`Insert,
`F(i64),
`Char(string),
`Null,
`Esc,
`CapsLock,
`ScrollLock,
`NumLock,
`PrintScreen,
`Pause,
`Menu,
`KeypadBegin,
`Media(MediaKeyCode),
`Modifier(ModifierKeyCode)
];
type KeyModifier = [
`Shift,
`Control,
`Alt,
`Super,
`Hyper,
`Meta
];
type KeyEventKind = [
`Press,
`Repeat,
`Release
];
type KeyEventState = [
`Keypad,
`CapsLock,
`NumLock
];
type KeyEvent = {
code: KeyCode,
kind: KeyEventKind,
modifiers: Array<KeyModifier>,
state: Array<KeyEventState>
};
type MouseButton = [
`Left,
`Right,
`Middle
];
type MouseEventKind = [
`Down(MouseButton),
`Up(MouseButton),
`Drag(MouseButton),
`Moved,
`ScrollDown,
`ScrollUp,
`ScrollLeft,
`ScrollRight
];
type MouseEvent = {
column: i64,
kind: MouseEventKind,
modifiers: Array<KeyModifier>,
row: i64
};
type Event = [
`FocusGained,
`FocusLost,
`Key(KeyEvent),
`Mouse(MouseEvent),
`Paste(string),
`Resize(i64, i64)
];
type InputHandler = {
child: &Tui,
enabled: &[bool, null],
handle: &fn(e: Event) -> [`Stop, `Continue]
};
val input_handler: fn(
?#enabled: &[bool, null],
#handle: &fn(e: Event) -> [`Stop, `Continue] throws 'e,
child: &Tui
) -> Tui throws 'e;