[wxPython] joysticks

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[wxPython] joysticks

Reza Habib
Hello.  I need to write a program that accepts joystick input.  I'm new to
python and wxpython, although I've been programming in c++ for a while and
have also been following the wxwindows library for a while.  In the wxpython
documentation, it says that the joystick events are supported, but I
couldn't find the joystick class that polls for the presence of a joystick
and captures joystick input.  So my question is this: without the joystick
class, can I receive joystick events in my window?

Also, this program needs to do some very simple animation - move a simple
object (like a + sign) over the screen and have the subject follow it with
the joystick.  This means that I will have to have drawing code within a
timer.  Is python's speed fast enough for such a program, or should I code
it in c++ (I would prefer python if for no other reason than as a way to
become more familiar with it).

Thanks in advance.

Reza


_______________________________________________
wxPython-users maillist  -  [hidden email]
http://starship.python.net/mailman/listinfo/wxpython-users



Reply | Threaded
Open this post in threaded view
|

Re: [wxPython] joysticks

Robin Dunn
> Hello.  I need to write a program that accepts joystick input.  I'm new to
> python and wxpython, although I've been programming in c++ for a while and
> have also been following the wxwindows library for a while.  In the
wxpython
> documentation, it says that the joystick events are supported, but I
> couldn't find the joystick class that polls for the presence of a joystick
> and captures joystick input.  So my question is this: without the joystick
> class, can I receive joystick events in my window?
>

I havn't added the joystick classes yet, but after a quick look it should be
easy to do.  I'll do it for the next release.


> Also, this program needs to do some very simple animation - move a simple
> object (like a + sign) over the screen and have the subject follow it with
> the joystick.  This means that I will have to have drawing code within a
> timer.  Is python's speed fast enough for such a program, or should I code
> it in c++ (I would prefer python if for no other reason than as a way to
> become more familiar with it).
>

For simple to medium complexity drawings Python is fast enough, assuming you
have a pentium or better CPU.  I would only start worrying about Python's
speed for highly complex drawing routines, but then there are some things
that can be done to optimize it such as only drawing the parts that have been
exposed, etc.

--
Robin Dunn
Software Craftsman
[hidden email]
http://AllDunn.com/robin/
http://AllDunn.com/wxPython/  Check it out!



_______________________________________________
wxPython-users maillist  -  [hidden email]
http://starship.python.net/mailman/listinfo/wxpython-users