Did I find the right examples for you? yes no

All Samples(39)  |  Call(39)  |  Derive(0)  |  Import(0)
pygame.joystick.get_count(): return count
number of joysticks on the system

src/g/a/GameDevelopment-HEAD/examples/pygame/basics/pygame_test.py   GameDevelopment(Download)
 
# Detect if joystick is available
joysticks = pygame.joystick.get_count()
if joysticks:
	print str(joysticks) + " joystick(s) detected!"

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/d/u/duinobot-0.13-2/joystick.py   duinobot(Download)
def joysticks():
	"Retorna una lista joysticks conectados"
	Joystick._Joystick__refresh()
	joys = []
	for id in range(pygame.joystick.get_count()):
class Joystick:
	"Permite controlar un robot con un joystick"
	joystickDetected = pygame.joystick.get_count() > 0
	@classmethod
	def __refresh(cls):
		"""Esta función permite conectar el joystick aun después de haber
		importado el módulo, pero solo tendrá efecto una vez luego de
		detectar algún joystick (es decir si se conectan o desconectan
		joysticks más tarde la función no tendrá efecto)"""
		if pygame.joystick.get_count() == 0 and not Joystick.joystickDetected:
			pygame.joystick.quit()
			pygame.joystick.init()
			Joystick.joystickDetected = pygame.joystick.get_count() > 0
 
 

src/c/r/crazyflie-clients-python-HEAD/lib/cfclient/utils/pygamereader.py   crazyflie-clients-python(Download)
        pygame.joystick.init()
        names = []
        nbrOfInputs = pygame.joystick.get_count()
        for i in range(0,nbrOfInputs):
            j = pygame.joystick.Joystick(i)

src/k/i/Kivy-1.8.0/kivy/input/providers/androidjoystick.py   Kivy(Download)
    def start(self):
        pygame.joystick.init()
        Logger.info('Android: found %d joystick' % pygame.joystick.get_count())
        for i in range(pygame.joystick.get_count()):
            self.create_joystick(i)

src/p/y/pyrocket-HEAD/src/rocket_joystick.py   pyrocket(Download)
		pygame.joystick.get_init()	#verify initialization (boolean)
 
		joystick_count = pygame.joystick.get_count()	# get number of joysticks
		print('%d joystick(s) connected' %joystick_count)
		if not joystick_count:

src/k/i/kivy-HEAD/kivy/input/providers/androidjoystick.py   kivy(Download)
    def start(self):
        pygame.joystick.init()
        Logger.info('Android: found %d joystick' % pygame.joystick.get_count())
        for i in range(pygame.joystick.get_count()):
            self.create_joystick(i)

src/p/y/pyNekketsu-HEAD/engine/inputs.py   pyNekketsu(Download)
class Inputs():
    #will only work with hats joystics
    print(pygame.joystick.get_count(), "joystics found.")
    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):

src/p/y/python-rpg-engine-HEAD/game.py   python-rpg-engine(Download)
        """
        pygame.joystick.init()
        if pygame.joystick.get_count() == 0:
            return
        for joystick_id in range(0, pygame.joystick.get_count()):

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

  1 | 2 | 3  Next