summaryrefslogtreecommitdiffstats
path: root/third_party/python/blessed/blessed/keyboard.pyi
blob: ae76393f14d1e255f81f5e6743c86c602647cf51 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# std imports
from typing import Set, Dict, Type, Mapping, TypeVar, Iterable, Optional, OrderedDict

# local
from .terminal import Terminal

_T = TypeVar("_T")

class Keystroke(str):
    def __new__(
        cls: Type[_T],
        ucs: str = ...,
        code: Optional[int] = ...,
        name: Optional[str] = ...,
    ) -> _T: ...
    @property
    def is_sequence(self) -> bool: ...
    @property
    def name(self) -> Optional[str]: ...
    @property
    def code(self) -> Optional[int]: ...

def get_keyboard_codes() -> Dict[int, str]: ...
def get_keyboard_sequences(term: Terminal) -> OrderedDict[str, int]: ...
def get_leading_prefixes(sequences: Iterable[str]) -> Set[str]: ...
def resolve_sequence(
    text: str, mapper: Mapping[str, int], codes: Mapping[int, str]
) -> Keystroke: ...