simulation.py
def _loop(self): # {{{0
    "Main loop: process key events, mouse events, and changes to GUI settings"
    tickCounter = 0
    startTime = monotonic()
    getTickTime = lambda f: startTime + INPUT_SLEEP * f
    try:
      while self.app.isConnected():
        tickCounter += 1
        # Handle key events
        with self.kbm:
          if self.args.debug:
            self.kbm.debugDumpKeys()
        # Handle mouse events
        if self.args.debug:
          for e in p.getMouseEvents():
            tp, mx, my, bi, bs = e
            tpname = B3.getMouseEventName(tp, short=True)
            bname = B3.getMouseButtonName(bi, short=True)
            bstates = B3.getMouseStateNames(bs, short=True)
            print("{} {}: x={} y={} b={} {!r} s={} {}: {}".format(
              tp, tpname, mx, my, bi, bname, bs, "+".join(bstates), e))
        # Update continuous variables
        self.app.tick()
        # Sleep until the next tick
        nextTickTime = getTickTime(tickCounter + 1)
        dt = nextTickTime - monotonic()
        if dt > 0:
          time.sleep(dt)
    except p.NotConnectedError:
      pass
    except p.error as e:
      logger.exception(e)
Main loop: process key events, mouse events, and changes to GUI settings
Main loop: process key events, mouse events, and changes to GUI settings
Main loop : process key events mouse events and changes to GUI settings
def _loop(self): 
    tickCounter = 0
    startTime = monotonic()
    getTickTime = lambda f: startTime + INPUT_SLEEP * f
    try:
      while self.app.isConnected():
        tickCounter += 1
        with self.kbm:
          if self.args.debug:
            self.kbm.debugDumpKeys()
        if self.args.debug:
          for e in p.getMouseEvents():
            tp, mx, my, bi, bs = e
            tpname = B3.getMouseEventName(tp, short=True)
            bname = B3.getMouseButtonName(bi, short=True)
            bstates = B3.getMouseStateNames(bs, short=True)
            print("{} {}: x={} y={} b={} {!r} s={} {}: {}".format(
              tp, tpname, mx, my, bi, bname, bs, "+".join(bstates), e))
        self.app.tick()
        nextTickTime = getTickTime(tickCounter + 1)
        dt = nextTickTime - monotonic()
        if dt > 0:
          time.sleep(dt)
    except p.NotConnectedError:
      pass
    except p.error as e:
      logger.exception(e)
def _loop ( self ) : tickCounter = 0 startTime = monotonic ( ) getTickTime = lambda f : startTime + INPUT_SLEEP * f try : while self . app . isConnected ( ) : tickCounter += 1 with self . kbm : if self . args . debug : self . kbm . debugDumpKeys ( ) if self . args . debug : for e in p . getMouseEvents ( ) : tp , mx , my , bi , bs = e tpname = B3 . getMouseEventName ( tp , short = True ) bname = B3 . getMouseButtonName ( bi , short = True ) bstates = B3 . getMouseStateNames ( bs , short = True ) print ( "{} {}: x={} y={} b={} {!r} s={} {}: {}" . format ( tp , tpname , mx , my , bi , bname , bs , "+" . join ( bstates ) , e ) ) self . app . tick ( ) nextTickTime = getTickTime ( tickCounter + 1 ) dt = nextTickTime - monotonic ( ) if dt > 0 : time . sleep ( dt ) except p . NotConnectedError : pass except p . error as e : logger . exception ( e )
Main loop: process key events, mouse events, and changes to GUI settings
Main loop : process key events mouse events and changes to GUI settings
# {{{0 "Main loop: process key events, mouse events, and changes to GUI settings" # Handle key events # Handle mouse events # Update continuous variables # Sleep until the next tick
self