batgrl.terminal.events#
Terminal Events.
Module Attributes
A special keyboard key. |
|
A printable character keyboard key. |
|
A keyboard key. |
|
A mouse button. |
|
A mouse event type. |
Classes
|
A background or foreground color report event. |
A cursor position response event. |
|
|
A primary device attributes report event. |
|
Base event. |
|
A focus event. |
|
A key event. |
|
A mouse event. |
|
A paste event. |
|
A terminal resize event. |
|
Event generated from an unknown ansi escape sequence. |
- batgrl.terminal.events.CharKey#
A printable character keyboard key.
alias of
Literal
[’ ‘, ‘!’, ‘”’, ‘#’, ‘$’, ‘%’, ‘&’, “’”, ‘(’, ‘)’, ‘*’, ‘+’, ‘,’, ‘-’, ‘.’, ‘/’, ‘0’, ‘1’, ‘2’, ‘3’, ‘4’, ‘5’, ‘6’, ‘7’, ‘8’, ‘9’, ‘:’, ‘;’, ‘<’, ‘=’, ‘>’, ‘?’, ‘@’, ‘A’, ‘B’, ‘C’, ‘D’, ‘E’, ‘F’, ‘G’, ‘H’, ‘I’, ‘J’, ‘K’, ‘L’, ‘M’, ‘N’, ‘O’, ‘P’, ‘Q’, ‘R’, ‘S’, ‘T’, ‘U’, ‘V’, ‘W’, ‘X’, ‘Y’, ‘Z’, ‘[’, ‘\’, ‘]’, ‘^’, ‘_’, ‘`’, ‘a’, ‘b’, ‘c’, ‘d’, ‘e’, ‘f’, ‘g’, ‘h’, ‘i’, ‘j’, ‘k’, ‘l’, ‘m’, ‘n’, ‘o’, ‘p’, ‘q’, ‘r’, ‘s’, ‘t’, ‘u’, ‘v’, ‘w’, ‘x’, ‘y’, ‘z’, ‘{’, ‘|’, ‘}’, ‘~’]
- class batgrl.terminal.events.ColorReportEvent(kind: Literal['fg', 'bg'], color: Color)#
Bases:
Event
A background or foreground color report event.
- Parameters:
- kindLiteral[“fg”, “bg”]
Whether report is for a foreground (“fg”) or background (“bg”) color.
- colorColor
The reported color.
- Attributes:
- kindLiteral[“fg”, “bg”]
Whether report is for a foreground (“fg”) or background (“bg”) color.
- colorColor
The reported color.
- kind: Literal['fg', 'bg']#
Whether report is for a foreground (“fg”) or background (“bg”) color.
- class batgrl.terminal.events.CursorPositionResponseEvent(pos: Point)#
Bases:
Event
A cursor position response event.
- Parameters:
- posPoint
The reported cursor position.
- Attributes:
- posPoint
The reported cursor position.
- class batgrl.terminal.events.DeviceAttributesReportEvent(device_attributes: frozenset[int])#
Bases:
Event
A primary device attributes report event.
A description of the primary device attributes can be found at https://vt100.net/docs/vt510-rm/chapter4.html. (Search text for “Primary Device Attributes”).
- Parameters:
- device_attributesfrozenset[int]
Reported terminal attributes.
- Attributes:
- device_attributesfrozenset[int]
Reported terminal attributes.
- device_attributes: frozenset[int]#
Reported terminal attributes.
- class batgrl.terminal.events.Event#
Bases:
object
Base event.
- class batgrl.terminal.events.FocusEvent(focus: Literal['in', 'out'])#
Bases:
Event
A focus event.
- Parameters:
- focusLiteral[“in”, “out”]
The type of focus; either
"in"
or"out"
.
- Attributes:
- focusLiteral[“in”, “out”]
The type of focus; either
"in"
or"out"
.
- focus: Literal['in', 'out']#
The type of focus; either
"in"
or"out"
.
- batgrl.terminal.events.Key#
A keyboard key.
alias of
Literal
[‘backspace’, ‘delete’, ‘down’, ‘end’, ‘enter’, ‘escape’, ‘f1’, ‘f2’, ‘f3’, ‘f4’, ‘f5’, ‘f6’, ‘f7’, ‘f8’, ‘f9’, ‘f10’, ‘f11’, ‘f12’, ‘f13’, ‘f14’, ‘f15’, ‘f16’, ‘f17’, ‘f18’, ‘f19’, ‘f20’, ‘f21’, ‘f22’, ‘f23’, ‘f24’, ‘home’, ‘insert’, ‘left’, ‘page_down’, ‘page_up’, ‘right’, ‘scroll_down’, ‘scroll_up’, ‘tab’, ‘up’] |Literal
[’ ‘, ‘!’, ‘”’, ‘#’, ‘$’, ‘%’, ‘&’, “’”, ‘(’, ‘)’, ‘*’, ‘+’, ‘,’, ‘-’, ‘.’, ‘/’, ‘0’, ‘1’, ‘2’, ‘3’, ‘4’, ‘5’, ‘6’, ‘7’, ‘8’, ‘9’, ‘:’, ‘;’, ‘<’, ‘=’, ‘>’, ‘?’, ‘@’, ‘A’, ‘B’, ‘C’, ‘D’, ‘E’, ‘F’, ‘G’, ‘H’, ‘I’, ‘J’, ‘K’, ‘L’, ‘M’, ‘N’, ‘O’, ‘P’, ‘Q’, ‘R’, ‘S’, ‘T’, ‘U’, ‘V’, ‘W’, ‘X’, ‘Y’, ‘Z’, ‘[’, ‘\’, ‘]’, ‘^’, ‘_’, ‘`’, ‘a’, ‘b’, ‘c’, ‘d’, ‘e’, ‘f’, ‘g’, ‘h’, ‘i’, ‘j’, ‘k’, ‘l’, ‘m’, ‘n’, ‘o’, ‘p’, ‘q’, ‘r’, ‘s’, ‘t’, ‘u’, ‘v’, ‘w’, ‘x’, ‘y’, ‘z’, ‘{’, ‘|’, ‘}’, ‘~’]
- class batgrl.terminal.events.KeyEvent(key: Literal['backspace', 'delete', 'down', 'end', 'enter', 'escape', 'f1', 'f2', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', 'f10', 'f11', 'f12', 'f13', 'f14', 'f15', 'f16', 'f17', 'f18', 'f19', 'f20', 'f21', 'f22', 'f23', 'f24', 'home', 'insert', 'left', 'page_down', 'page_up', 'right', 'scroll_down', 'scroll_up', 'tab', 'up', ' ', '!', '"', '#', '$', '%', '&', "'", '(', ')', '*', '+', ',', '-', '.', '/', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '<', '=', '>', '?', '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '[', '\\', ']', '^', '_', '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '{', '|', '}', '~'], alt: bool = False, ctrl: bool = False, shift: bool = False)#
Bases:
Event
A key event.
- Parameters:
- keyKey
The pressed key.
- altbool, default: False
Whether alt was pressed.
- ctrlbool, default: False
Whether ctrl was pressed.
- shiftbool, default: False
Whether shift was pressed.
- Attributes:
- alt: bool = False#
Whether alt was pressed.
- property control: bool#
Alias for
ctrl
.
- ctrl: bool = False#
Whether ctrl was pressed.
- key: Literal['backspace', 'delete', 'down', 'end', 'enter', 'escape', 'f1', 'f2', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', 'f10', 'f11', 'f12', 'f13', 'f14', 'f15', 'f16', 'f17', 'f18', 'f19', 'f20', 'f21', 'f22', 'f23', 'f24', 'home', 'insert', 'left', 'page_down', 'page_up', 'right', 'scroll_down', 'scroll_up', 'tab', 'up', ' ', '!', '"', '#', '$', '%', '&', "'", '(', ')', '*', '+', ',', '-', '.', '/', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '<', '=', '>', '?', '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '[', '\\', ']', '^', '_', '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '{', '|', '}', '~']#
The pressed key.
- property meta: bool#
Alias for
alt
.
- shift: bool = False#
Whether shift was pressed.
- batgrl.terminal.events.MouseButton#
A mouse button.
alias of
Literal
[‘left’, ‘middle’, ‘no_button’, ‘right’]
- class batgrl.terminal.events.MouseEvent(pos: Point, button: Literal['left', 'middle', 'no_button', 'right'], event_type: Literal['mouse_down', 'mouse_move', 'mouse_up', 'scroll_down', 'scroll_up'], alt: bool, ctrl: bool, shift: bool, dy: int, dx: int, nclicks: int = 0)#
Bases:
Event
A mouse event.
- Parameters:
- posPoint
The mouse position.
- buttonMouseButton
The mouse button.
- event_typeMouseEventType
The mouse event type.
- altbool
Whether alt was pressed.
- ctrlbool
Whether ctrl was pressed.
- shiftbool
Whether shift was pressed.
- dyint
The change in y-coordinate of the mouse position.
- dxint
The change in x-coordinate of the mouse position.
- nclicksint, default: 0
The number of consecutive
"mouse_down"
events with same button.
- Attributes:
- posPoint
The mouse position.
- buttonMouseButton
The mouse button.
- event_typeMouseEventType
The mouse event type.
- altbool
Whether alt was pressed.
- ctrlbool
Whether ctrl was pressed.
- shiftbool
Whether shift was pressed.
- dyint
The change in y-coordinate of the mouse position.
- dxint
The change in x-coordinate of the mouse position.
- nclicksint
The number of consecutive
"mouse_down"
events with same button.meta
boolAlias for
alt
.control
boolAlias for
ctrl
.
- alt: bool#
Whether alt was pressed.
- button: Literal['left', 'middle', 'no_button', 'right']#
The mouse button.
- property control: bool#
Alias for
ctrl
.
- ctrl: bool#
Whether ctrl was pressed.
- dx: int#
The change in x-coordinate of the mouse position.
- dy: int#
The change in y-coordinate of the mouse position.
- event_type: Literal['mouse_down', 'mouse_move', 'mouse_up', 'scroll_down', 'scroll_up']#
The mouse event type.
- property meta: bool#
Alias for
alt
.
- nclicks: int = 0#
The number of consecutive
"mouse_down"
events with same button.
- shift: bool#
Whether shift was pressed.
- batgrl.terminal.events.MouseEventType#
A mouse event type.
alias of
Literal
[‘mouse_down’, ‘mouse_move’, ‘mouse_up’, ‘scroll_down’, ‘scroll_up’]
- class batgrl.terminal.events.PasteEvent(paste: str)#
Bases:
Event
A paste event.
- Parameters:
- pastestr
The paste content.
- Attributes:
- pastestr
The paste content.
- paste: str#
The paste content.
- class batgrl.terminal.events.ResizeEvent(size: Size)#
Bases:
Event
A terminal resize event.
- Parameters:
- sizeSize
The new terminal size.
- Attributes:
- sizeSize
The new terminal size.
- batgrl.terminal.events.SpecialKey#
A special keyboard key.
alias of
Literal
[‘backspace’, ‘delete’, ‘down’, ‘end’, ‘enter’, ‘escape’, ‘f1’, ‘f2’, ‘f3’, ‘f4’, ‘f5’, ‘f6’, ‘f7’, ‘f8’, ‘f9’, ‘f10’, ‘f11’, ‘f12’, ‘f13’, ‘f14’, ‘f15’, ‘f16’, ‘f17’, ‘f18’, ‘f19’, ‘f20’, ‘f21’, ‘f22’, ‘f23’, ‘f24’, ‘home’, ‘insert’, ‘left’, ‘page_down’, ‘page_up’, ‘right’, ‘scroll_down’, ‘scroll_up’, ‘tab’, ‘up’]