Пример #1
0
    GameLogic.Object = {}
    print("BLENDER: GameLogic object created")
    GameLogic.Object['closed'] = False

    GameLogic.setLogicTicRate(100)

    mice = xinput.find_mice(model="G500")
    for mouse in mice:
        # xinput.set_owner(mouse) # Don't need this if using correct udev rule
        xinput.switch_mode(mouse)

    blenderpath = GameLogic.expandPath('//')

    for mouseno in range(0, len(mice), 2):
        s1, conn1, addr1, p1 = \
            gu.spawn_process("\0mouse%dsocket" % int(mouseno/2), 
                          ['%s/evread/readout' % blenderpath, '%d' % mice[mouseno].evno, '%d' % (mouseno/2)])
        
        conn1.send(b'start')

        gu.recv_ready(conn1)

        conn1.setblocking(0)

        GameLogic.Object['m%dconn' % (int(mouseno/2) + 1)] = conn1

# define main program
def main():
    if GameLogic.Object['closed']:
        return

    # get controller
Пример #2
0
    print(blenderpath)
    GameLogic.Object = {}
    print("BLENDER: GameLogic object created")
    GameLogic.Object['closed'] = False
    
    GameLogic.setLogicTicRate(60)
    
    mice = xinput.find_mice(model="Mouse")
    m = [mice[0],mice[1]]
    for mouse in m:
        xinput.set_owner(mouse) # Don't need this if using correct udev rule
        xinput.switch_mode(mouse)
        
    if len(mice):   
        s1, conn1, addr1, p1 = \
            gu.spawn_process("\0mouse0socket", 
                          ['%s/evread/readout' % blenderpath, '%d' % mice[0].evno, '0'])
        s2, conn2, addr2, p2 = \
            gu.spawn_process("\0mouse1socket", 
                          ['%s/evread/readout' % blenderpath, '%d' % mice[1].evno, '1'])
        
        conn1.send(b'start')
        conn2.send(b'start')
        
        gu.recv_ready(conn1)
        gu.recv_ready(conn2)

        conn1.setblocking(0)
        conn2.setblocking(0)

        GameLogic.Object['m1conn'] = conn1
        GameLogic.Object['m2conn'] = conn2
Пример #3
0
    GameLogic.Object = {}
    print("BLENDER: GameLogic object created")
    GameLogic.Object['closed'] = False

    GameLogic.setLogicTicRate(100)

    mice = xinput.find_mice(model="G500")
    for mouse in mice:
        # xinput.set_owner(mouse) # Don't need this if using correct udev rule
        xinput.switch_mode(mouse)

    blenderpath = GameLogic.expandPath('//')

    for mouseno in range(0, len(mice), 2):
        s1, conn1, addr1, p1 = \
            gu.spawn_process("\0mouse%dsocket" % int(mouseno/2),
                          ['%s/evread/readout' % blenderpath, '%d' % mice[mouseno].evno, '%d' % (mouseno/2)])

        conn1.send(b'start')

        gu.recv_ready(conn1)

        conn1.setblocking(0)

        GameLogic.Object['m%dconn' % (int(mouseno / 2) + 1)] = conn1


# define main program
def main():
    if GameLogic.Object['closed']:
        return