(self)
Reset event triggers.
Reset event triggers.
Reset event triggers .
def reset(self):
        """Reset event triggers."""
        # KEY: init key events
        keys = [
            scancode.F1, scancode.F2, scancode.F3, scancode.F4, scancode.F5,
            scancode.F6, scancode.F7, scancode.F8, scancode.F9, scancode.F10]
        if self._num_fn_keys == 12:
            # Tandy only
            keys += [scancode.F11, scancode.F12]
        keys += [scancode.UP, scancode.LEFT, scancode.RIGHT, scancode.DOWN]
        keys += [None] * (20 - self._num_fn_keys - 4)
        self.key = [KeyHandler(sc) for sc in keys]
        # other events
        self.timer = TimerHandler(self._clock)
        self.play = PlayHandler(self._sound)
        self.com = [
            ComHandler(self._files.get_device(b'COM1:')),
            ComHandler(self._files.get_device(b'COM2:'))]
        self.pen = PenHandler()
        # joy*2 + button
        self.strig = [
            StrigHandler(joy, button)
            for joy in range(2) for button in range(2)
        ]
        # all handlers in order of handling; TIMER first
        # key events are not handled FIFO but first 11-20 in that order, then 1-10
        self.all = ([self.timer]
            + [self.key[num] for num in (list(range(10, 20)) + list(range(10)))]
            + [self.play] + self.com + [self.pen] + self.strig)
        # keep a list of enabled events
        self.enabled = set()
        # set suspension off
        self.suspend_all = False
def reset ( self ) : # KEY: init key events keys = [ scancode . F1 , scancode . F2 , scancode . F3 , scancode . F4 , scancode . F5 , scancode . F6 , scancode . F7 , scancode . F8 , scancode . F9 , scancode . F10 ] if self . _num_fn_keys == 12 : # Tandy only keys += [ scancode . F11 , scancode . F12 ] keys += [ scancode . UP , scancode . LEFT , scancode . RIGHT , scancode . DOWN ] keys += [ None ] * ( 20 - self . _num_fn_keys - 4 ) self . key = [ KeyHandler ( sc ) for sc in keys ] # other events self . timer = TimerHandler ( self . _clock ) self . play = PlayHandler ( self . _sound ) self . com = [ ComHandler ( self . _files . get_device ( b'COM1:' ) ) , ComHandler ( self . _files . get_device ( b'COM2:' ) ) ] self . pen = PenHandler ( ) # joy*2 + button self . strig = [ StrigHandler ( joy , button ) for joy in range ( 2 ) for button in range ( 2 ) ] # all handlers in order of handling; TIMER first # key events are not handled FIFO but first 11-20 in that order, then 1-10 self . all = ( [ self . timer ] + [ self . key [ num ] for num in ( list ( range ( 10 , 20 ) ) + list ( range ( 10 ) ) ) ] + [ self . play ] + self . com + [ self . pen ] + self . strig ) # keep a list of enabled events self . enabled = set ( ) # set suspension off self . suspend_all = False