def __init__(self,
              profile,
              scheduler,
              keyboard=b"SCController Keyboard",
              mouse=None):
     Mapper.__init__(self, profile, scheduler, keyboard, mouse, None)
     self._feedback_cb = None
Ejemplo n.º 2
0
    def run_scheduled(self):
        """
		Should be called periodically to keep timers going.
		Since SlaveMapper doesn't communicate with controller device, it is not
		possible to drive this automatically
		"""
        now = time.time()
        Mapper.run_scheduled(self, now)
        return True
    def wrapper(*a):
        _time = time.time

        def fake_time():
            return fake_time.t

        def add(n):
            fake_time.t += n

        fake_time.t = _time()
        fake_time.add = add
        time.time = fake_time

        controller = FakeController(0)
        profile = Profile(parser)
        scheduler = Scheduler()
        mapper = Mapper(profile,
                        scheduler,
                        keyboard=False,
                        mouse=False,
                        gamepad=False,
                        poller=None)
        mapper.keyboard = RememberingDummy()
        mapper.gamepad = RememberingDummy()
        mapper.mouse = RememberingDummy()
        mapper.set_controller(controller)
        mapper._testing = True
        mapper._tick_rate = 0.01

        _mapper_input = mapper.input

        def mapper_input(*a):
            add(mapper._tick_rate)
            _mapper_input(*a)
            scheduler.run()

        mapper.input = mapper_input

        a = list(a) + [mapper]
        try:
            return fn(*a)
        finally:
            time.time = _time
Ejemplo n.º 4
0
 def __init__(self, profile, keyboard=b"SCController Keyboard", mouse=None):
     Mapper.__init__(self, profile, keyboard, mouse, None)
Ejemplo n.º 5
0
	def __init__(self, profile, scheduler, keyboard=b"SCController Keyboard", mouse=None):
		Mapper.__init__(self, profile, scheduler, keyboard, mouse, None)
		self._feedback_cb = None
Ejemplo n.º 6
0
 def __init__(self, profile, keyboard=b"SCC OSD Keyboard", mouse=None):
     Mapper.__init__(self, profile, keyboard, mouse, None)
     self._feedback_cb = None