(self, expand=True)
Read one byte from keyboard buffer, expanding macros if required.
Read one byte from keyboard buffer, expanding macros if required.
Read one byte from keyboard buffer expanding macros if required .
def _read_byte(self, expand=True):
        """Read one byte from keyboard buffer, expanding macros if required."""
        try:
            return self._expansion_vessel.pop(0)
        except IndexError:
            pass
        c = self.buf.getc()
        if not expand or c not in FUNCTION_KEY:
            return c
        # function key macro expansion
        self._expansion_vessel = list(iterchar(self._key_replace[FUNCTION_KEY[c]]))
        try:
            return self._expansion_vessel.pop(0)
        except IndexError:
            # function macro has been redefined as empty: return scancode
            # e.g. KEY 1, "" enables catching F1 with INKEY$
            return c
def _read_byte ( self , expand = True ) : try : return self . _expansion_vessel . pop ( 0 ) except IndexError : pass c = self . buf . getc ( ) if not expand or c not in FUNCTION_KEY : return c # function key macro expansion self . _expansion_vessel = list ( iterchar ( self . _key_replace [ FUNCTION_KEY [ c ] ] ) ) try : return self . _expansion_vessel . pop ( 0 ) except IndexError : # function macro has been redefined as empty: return scancode # e.g. KEY 1, "" enables catching F1 with INKEY$ return c