示例#1
0
 def init_mice(self, init_pos=(0,0)):
     n = manymouse.init()
     self.mice = []
     
     if n == 0:
         print 'No mice detected!'
     else:
         for i in range(n):
             name = manymouse.device_name(i)
             mouse = Mouse(i, name, init_pos)
             self.mice.append(mouse)
             print '#%s: %s' % (i, name)
示例#2
0
    def init_mice(self, init_pos=(0, 0)):
        n = manymouse.init()
        self.mice = []

        if n == 0:
            print "No mice detected!"
        else:
            for i in range(n):
                name = manymouse.device_name(i)
                mouse = Mouse(i, name, init_pos)
                self.mice.append(mouse)
                print "#%s: %s" % (i, name)
def init_mice(screen_w, screen_h):
    global available_mice, mice
    available_mice = min(manymouse.init(), MAX_MICE)
    mice = []
    
    if available_mice == 0:
        print 'No mice detected!'
    else:
        for i in range(available_mice):
            name = manymouse.device_name(i)
            mouse = Mouse(screen_w/2, screen_h/2, tuple(random.randint(0,255) for x in range(3)))
            mouse.name = name
            mouse.connected = True
            mice.append(mouse)            
            print '#%s: %s' % (i, mice[i].name)
示例#4
0
def init_mice(screen_w, screen_h):
    global available_mice, mice
    available_mice = min(manymouse.init(), MAX_MICE)
    mice = []

    if available_mice == 0:
        print 'No mice detected!'
    else:
        for i in range(available_mice):
            name = manymouse.device_name(i)
            mouse = Mouse(screen_w / 2, screen_h / 2,
                          tuple(random.randint(0, 255) for x in range(3)))
            mouse.name = name
            mouse.connected = True
            mice.append(mouse)
            print '#%s: %s' % (i, mice[i].name)