O grupo no qual você está postando é um grupo da Usenet. As mensagens postadas neste grupo farão com que o seu e-mail fique visível para qualquer pessoa na internet.
I am trying to use a gamepad for a game project but whenever I check for a pad event I get some printing in the console. I saw some discutions about the subject but no solution.
I am on windows7 python26 pygame191 and I develop on Eclipse with pydev.
Does someone have encounter the same problem and found a solution?
> I am trying to use a gamepad for a game project but whenever I check for a > pad event I get some printing in the console. > I saw some discutions about the subject but no solution.
> I am on windows7 python26 pygame191 and I develop on Eclipse with pydev.
> Does someone have encounter the same problem and found a solution?
On Thu, Nov 12, 2009 at 11:23 PM, Thiago Chaves <shundr...@gmail.com> wrote: > You might want to be more specific.
> -Thiago
> On Thu, Nov 12, 2009 at 7:36 PM, rouiller olivier <o.rouil...@gmail.com> > wrote:
>> Hi everyone,
>> I am trying to use a gamepad for a game project but whenever I check for a >> pad event I get some printing in the console. >> I saw some discutions about the subject but no solution.
>> I am on windows7 python26 pygame191 and I develop on Eclipse with pydev.
>> Does someone have encounter the same problem and found a solution?
Here is the code I use to test the pad, I found it on the net.
pygame.init() #joystick.init() j = pygame.joystick.Joystick(0) j.init() #print 'Initialized Joystick : %s' % j.get_name() try: while True: pygame.event.pump() for i in range(0, j.get_numaxes()): if j.get_axis(i) != 0.00: pass #print 'Axis %i reads %.2f' % (i, j.get_axis(i)) for i in range(0, j.get_numbuttons()): if j.get_button(i) != 0: pass #print 'Button %i reads %i' % (i, j.get_button(i)) except KeyboardInterrupt: j.quit()
As you can see I commented the prints but I still have the same output : SDL_JoystickGetButton value:0: SDL_JoystickGetButton value:0: SDL_JoystickGetAxis value:-257: SDL_JoystickGetAxis value:-257: SDL_JoystickGetAxis value:-257: SDL_JoystickGetAxis value:-257: SDL_JoystickGetButton value:0:
And so on... Were you able to use a joystick without output? If so do use a different of pygame or python?
Thanks for the help!
2009/11/12 Alex Nordlund <deep.alexan...@gmail.com>
> Check your code, comment out every line that begins with 'print' ;-)
> --- > //Alex
> On Thu, Nov 12, 2009 at 11:23 PM, Thiago Chaves <shundr...@gmail.com> > wrote: > > You might want to be more specific.
> > -Thiago
> > On Thu, Nov 12, 2009 at 7:36 PM, rouiller olivier <o.rouil...@gmail.com> > > wrote:
> >> Hi everyone,
> >> I am trying to use a gamepad for a game project but whenever I check for > a > >> pad event I get some printing in the console. > >> I saw some discutions about the subject but no solution.
> >> I am on windows7 python26 pygame191 and I develop on Eclipse with pydev.
> >> Does someone have encounter the same problem and found a solution?
> Here is the code I use to test the pad, I found it on the net.
> pygame.init() > #joystick.init() > j = pygame.joystick.Joystick(0) > j.init() > #print 'Initialized Joystick : %s' % j.get_name() > try: > while True: > pygame.event.pump() > for i in range(0, j.get_numaxes()): > if j.get_axis(i) != 0.00: > pass > #print 'Axis %i reads %.2f' % (i, j.get_axis(i)) > for i in range(0, j.get_numbuttons()): > if j.get_button(i) != 0: > pass > #print 'Button %i reads %i' % (i, j.get_button(i)) > except KeyboardInterrupt: > j.quit()
> As you can see I commented the prints but I still have the same output : > SDL_JoystickGetButton value:0: > SDL_JoystickGetButton value:0: > SDL_JoystickGetAxis value:-257: > SDL_JoystickGetAxis value:-257: > SDL_JoystickGetAxis value:-257: > SDL_JoystickGetAxis value:-257: > SDL_JoystickGetButton value:0:
> And so on... > Were you able to use a joystick without output? > If so do use a different of pygame or python?
> Thanks for the help!
> 2009/11/12 Alex Nordlund <deep.alexan...@gmail.com>
> Check your code, comment out every line that begins with 'print' ;-)
>> --- >> //Alex
>> On Thu, Nov 12, 2009 at 11:23 PM, Thiago Chaves <shundr...@gmail.com> >> wrote: >> > You might want to be more specific.
>> > -Thiago
>> > On Thu, Nov 12, 2009 at 7:36 PM, rouiller olivier <o.rouil...@gmail.com
>> > wrote:
>> >> Hi everyone,
>> >> I am trying to use a gamepad for a game project but whenever I check >> for a >> >> pad event I get some printing in the console. >> >> I saw some discutions about the subject but no solution.
>> >> I am on windows7 python26 pygame191 and I develop on Eclipse with >> pydev.
>> >> Does someone have encounter the same problem and found a solution?
rouiller olivier wrote: > The calls to get_axis and get_button cause these outputs... > Maybee there is another way of getting the values?..
Not sure if there is another way. Note that this is already fixed in svn trunk. So I guess you can either try to build pygame from source from the svn version or wait for the next release.
>> The calls to get_axis and get_button cause these outputs... >> Maybee there is another way of getting the values?..
> Not sure if there is another way. > Note that this is already fixed in svn trunk. > So I guess you can either try to build pygame from source from the svn > version or > wait for the next release.
Teste1.py controls a circle (and a line, if you have 2 or more directional pads) on the window. Teste2.py outputs button numbers and directional axes information (it's a bit spammy when you're dealing with analog directional buttons, it's just because there's so many different values the axes can take in that case).
-Thiago
On Fri, Nov 13, 2009 at 2:15 AM, rouiller olivier <o.rouil...@gmail.com>wrote:
>>> The calls to get_axis and get_button cause these outputs... >>> Maybee there is another way of getting the values?..
>> Not sure if there is another way. >> Note that this is already fixed in svn trunk. >> So I guess you can either try to build pygame from source from the svn >> version or >> wait for the next release.
Thanks for the file, they work well but I still have the spam. I guess I will have to deal with it til next release and hope the game will still be playable.
> Teste1.py controls a circle (and a line, if you have 2 or more directional > pads) on the window. > Teste2.py outputs button numbers and directional axes information (it's a > bit spammy when you're dealing with analog directional buttons, it's just > because there's so many different values the axes can take in that case).
> -Thiago
> On Fri, Nov 13, 2009 at 2:15 AM, rouiller olivier <o.rouil...@gmail.com>wrote:
>> ok thank's let's try to build it, should be a good exercise after all.
>>>> The calls to get_axis and get_button cause these outputs... >>>> Maybee there is another way of getting the values?..
>>> Not sure if there is another way. >>> Note that this is already fixed in svn trunk. >>> So I guess you can either try to build pygame from source from the svn >>> version or >>> wait for the next release.
Somehow the joystick extension module is being compiled with the debug switch set (DEBUG macro defined). Try getting the most recent build from SVN at http://thorbrian.com/pygame/builds.php. I think this problem should be fixed.
rouiller olivier wrote: > Thanks for the file, they work well but I still have the spam. > I guess I will have to deal with it til next release and hope the game > will still be playable.
> Teste1.py controls a circle (and a line, if you have 2 or more > directional pads) on the window. > Teste2.py outputs button numbers and directional axes information > (it's a bit spammy when you're dealing with analog directional > buttons, it's just because there's so many different values the > axes can take in that case).
> -Thiago
> On Fri, Nov 13, 2009 at 2:15 AM, rouiller olivier > <o.rouil...@gmail.com <mailto:o.rouil...@gmail.com>> wrote:
> ok thank's let's try to build it, should be a good exercise > after all.
> The calls to get_axis and get_button cause these > outputs... > Maybee there is another way of getting the values?..
> Not sure if there is another way. > Note that this is already fixed in svn trunk. > So I guess you can either try to build pygame from source > from the svn version or > wait for the next release.
> Somehow the joystick extension module is being compiled with the debug > switch set (DEBUG macro defined). Try getting the most recent build from SVN > at http://thorbrian.com/pygame/builds.php. I think this problem should be > fixed.
> Lenard Lindstrom
> rouiller olivier wrote:
>> Thanks for the file, they work well but I still have the spam. >> I guess I will have to deal with it til next release and hope the game >> will still be playable.
>> Teste1.py controls a circle (and a line, if you have 2 or more >> directional pads) on the window. >> Teste2.py outputs button numbers and directional axes information >> (it's a bit spammy when you're dealing with analog directional >> buttons, it's just because there's so many different values the >> axes can take in that case).
>> -Thiago
>> On Fri, Nov 13, 2009 at 2:15 AM, rouiller olivier >> <o.rouil...@gmail.com <mailto:o.rouil...@gmail.com>> wrote:
>> ok thank's let's try to build it, should be a good exercise >> after all.
>> The calls to get_axis and get_button cause these >> outputs... >> Maybee there is another way of getting the values?..
>> Not sure if there is another way. >> Note that this is already fixed in svn trunk. >> So I guess you can either try to build pygame from source >> from the svn version or >> wait for the next release.