Ejemplo n.º 1
0
    def __init__(self):
        """"""
        cf = CFG  # This contains the configuration. At this time, many config variables are being ignored.

        ev = EVDispatcher(cf)   # In a way this is the core of the program. It dispatches events between each module
                                # allowing for communications between each part of the program. It also loads
                                # EventBridges, which route events like mouse position or clicks to the OS

        UIManager(cf, ev)       # Loads one or more user interfaces
        MSManager(cf, ev)       # Motion analysis
        POManager(cf, ev)       # Handles the pointer, receives WM_IR, sends out ABS_POS absolute position reports
        wm = WMManager(cf, ev)  # Handles the Wiimote; connects to it, manages state and mode, parses reports

        CommandMapper(cf, ev)   # Maps Wiimote keys and other events to commands like key presses or clicks

        if wm.connect() and wm.setup():
            wm.main_loop()

        wm.disconnect()
Ejemplo n.º 2
0
  def __init__( self ):
    cf = CFG  # This contains the configuration. At this time, many config variables are being ignored.

    ev = EVDispatcher( cf )  # In a way this is the core of the program. It dispatches events between each module
                             # allowing for communications between each part of the program. It also loads
			     # EventBridges, which route events like mouse position or clicks to the OS

    ui = UIManager( cf, ev ) # Loads one or more user interfaces
   
    cm = CommandMapper( cf, ev ) # Maps Wiimote keys and other events to commands like key presses or clicks

    while(True):
      btaddr = sys.stdin.readline()
      cf['MY_WIIMOTE_ADDR'] = btaddr.rstrip()
      if (cf['MY_WIIMOTE_ADDR']):
        wm = WMManager( cf, ev ) # Handles the Wiimote; connects to it, manages wiimote state and mode, parses wiimote reports
        #ms = MSManager( cf, ev, wm.id ) # Motion analysis
        po = POManager( cf, ev, wm.id ) # Handles the pointer, receives WM_IR, sends out ABS_POS absolute position reports
      
        if wm.connect() and wm.setup():
          thread.start_new_thread(wm.main_loop, ())

    wm.disconnect()