Example #1
0
    def initInput(self):
        self.keyNames = {}
        self.keyMods = {}
        for name in dir(pygame):
            if name.startswith('K_'):
                self.keyNames[getattr(pygame,name)] = name[2:].lower()
            elif name.startswith('KMOD_'):
                self.keyMods[name[5:].lower()] = getattr(pygame,name)

        self.joystickCount = pygame.joystick.get_count()
        self.joysticks = []
        for i in range(self.joystickCount):
            joystick = pygame.joystick.Joystick(i)
            joystick.init()
            self.joysticks.append(joystick)

        self.mouseButtonNames = {1:'left',2:'middle',3:'right'}

        self.inputFuncs = util.getFuncs(self,'input_')
Example #2
0
 def __init__(self):
     self.textures = {}
     
     self.bindFuncs = util.getFuncs(self,"bind_")