INNER CODE UNIT · Python

getInput

pystardust/ytfzf · addons/interfaces/sixel-menu/menu.py:58

def getInput():
    seq = bytes()
    escapeSequence = False
    while len(seq) == 0 or escapeSequence:
        cur_char = bytes(sys.stdin.read(1), "utf-8")
        seq += cur_char
        if seq[-1] == 27:
            escapeSequence = True
        elif (escapeSequence and seq[-1] != 91) and \
                (seq[-1] > 57 or seq[-1] < 48) and \
                seq[-1] != 79 and seq[-1] != 59:
            escapeSequence = False
    return Key(Key.toString(seq), seq)


class Lines(list):
    renderCmd = ""

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…