Did I find the right examples for you? yes no

All Samples(44)  |  Call(42)  |  Derive(0)  |  Import(2)
pygame.joystick.Joystick(id): return Joystick
create a new Joystick object

src/g/a/GameDevelopment-HEAD/examples/pygame/basics/pygame_test.py   GameDevelopment(Download)
# Initialize each joystick
	for i in range(joysticks):
		joystick = pygame.joystick.Joystick(i)
		joystick.init()
		name = joystick.get_name()

src/m/e/meks-pygame-samples-HEAD/tank_turret/turret_gamepad.py   meks-pygame-samples(Download)
def initialize_all_gamepads():
    """Checks for gamepads and returns an initialized list of them if found."""
    joysticks = []
    for joystick_id in range(pg.joystick.get_count()):
        joysticks.append(pg.joystick.Joystick(joystick_id))

src/c/r/crazyflie-clients-python-HEAD/lib/cfclient/utils/pygamereader.py   crazyflie-clients-python(Download)
        self.data = {"roll":0.0, "pitch":0.0, "yaw":0.0, "thrust":0.0, "pitchcal":0.0, "rollcal":0.0, "estop": False, "exit":False, "althold":False}
        self.inputMap = inputMap
        self.j = pygame.joystick.Joystick(deviceId)
        self.j.init()
 
    def enableRawReading(self, deviceId):
        """Enable reading of raw values (without mapping)"""
        self.j = pygame.joystick.Joystick(deviceId)
        self.j.init()
 
        nbrOfInputs = pygame.joystick.get_count()
        for i in range(0,nbrOfInputs):
            j = pygame.joystick.Joystick(i)
            name = j.get_name()
            if names.count(name) > 0:

src/d/u/duinobot-0.13-2/joystick.py   duinobot(Download)
	joys = []
	for id in range(pygame.joystick.get_count()):
		j = pygame.joystick.Joystick(id)
		joys.append((id, j.get_name(),))
		j.quit()
	def __init__(self, robot, joystickNumber=0):
		"""Crea un joystick asociado con un objeto Robot, si
		no se idica el numero de joystick se asume 0"""
		Joystick.__refresh()
		self.js = pygame.joystick.Joystick(joystickNumber)

src/p/y/pyrocket-HEAD/src/rocket_joystick.py   pyrocket(Download)
			return False
 
		self.joystick_object = pygame.joystick.Joystick(0)
		self.joystick_object.init()
 

src/c/r/crazyflie-clients-python-HEAD/lib/cfclient/utils/joystick/pygamejoystick.py   crazyflie-clients-python(Download)
        count = pygame.joystick.get_count()
        for i in range(0, count):
            joy = pygame.joystick.Joystick(i)
            devices[i] = joy.get_name()
 
            raise Exception("Joystick already open")
 
        self.joy = pygame.joystick.Joystick(device_id)
        self.joy.init()
 

src/k/i/Kivy-1.8.0/kivy/input/providers/androidjoystick.py   Kivy(Download)
    def create_joystick(self, index):
        Logger.info('Android: create joystick <%d>' % index)
        js = pygame.joystick.Joystick(index)
        js.init()
        if js.get_numbuttons() == 0:

src/k/i/kivy-HEAD/kivy/input/providers/androidjoystick.py   kivy(Download)
    def create_joystick(self, index):
        Logger.info('Android: create joystick <%d>' % index)
        js = pygame.joystick.Joystick(index)
        js.init()
        if js.get_numbuttons() == 0:

src/i/n/interface2instrument-HEAD/HIDServer/hidserver.py   interface2instrument(Download)
 
        for n in range(pygame.joystick.get_count()): #
            stick = pygame.joystick.Joystick(n)
            stick.init() # init instance
            # report joystick charateristics #

src/p/y/pyNekketsu-HEAD/engine/inputs.py   pyNekketsu(Download)
    joystick=[]
    if (pygame.joystick.get_count()>0):
        joystick.append(pygame.joystick.Joystick(0))
        joystick[0].init()
        print("Joystick 1 \""+joystick[0].get_name()+"\" initialized.")
    if (pygame.joystick.get_count()>1):
        joystick.append(pygame.joystick.Joystick(1))

  1 | 2 | 3 | 4  Next