(self, cp_c, scan)
Append a single keystroke with eascii/codepage, scancode, modifier.
Append a single keystroke with eascii/codepage, scancode, modifier.
Append a single keystroke with eascii / codepage scancode modifier .
def append(self, cp_c, scan):
        """Append a single keystroke with eascii/codepage, scancode, modifier."""
        # if check_full is off, we pretend the ring buffer is infinite
        # this is for inserting keystrokes and pasting text into the emulator
        if cp_c:
            if self._check_full and len(self._buffer) - self._start >= self._ring_length-1:
                # when buffer is full, GW-BASIC inserts a \r at the end but doesn't count it
                self._buffer[self._start-1] = (b'\r', scancode.RETURN)
                # emit a sound signal; keystroke is dropped
                self._queues.audio.put(signals.Event(signals.AUDIO_TONE, FULL_TONE))
            else:
                self._buffer.append((cp_c, scan))
def append ( self , cp_c , scan ) : # if check_full is off, we pretend the ring buffer is infinite # this is for inserting keystrokes and pasting text into the emulator if cp_c : if self . _check_full and len ( self . _buffer ) - self . _start >= self . _ring_length - 1 : # when buffer is full, GW-BASIC inserts a \r at the end but doesn't count it self . _buffer [ self . _start - 1 ] = ( b'\r' , scancode . RETURN ) # emit a sound signal; keystroke is dropped self . _queues . audio . put ( signals . Event ( signals . AUDIO_TONE , FULL_TONE ) ) else : self . _buffer . append ( ( cp_c , scan ) )