~ubuntu-branches/ubuntu/feisty/pygame/feisty

« back to all changes in this revision

Viewing changes to docs/ref/pygame_joystick.html

  • Committer: Bazaar Package Importer
  • Author(s): Ed Boraas
  • Date: 2002-02-20 06:39:24 UTC
  • Revision ID: james.westby@ubuntu.com-20020220063924-amlzj7tqkeods4eq
Tags: upstream-1.4
ImportĀ upstreamĀ versionĀ 1.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<html>
 
2
<title>pygame.joystick</title>
 
3
<body bgcolor=#aaeebb text=#000000 link=#331111 vlink=#331111>
 
4
 
 
5
 
 
6
<table cellspacing=3 width=100%><tr><td bgcolor=#00000>
 
7
<table width=100%><tr><td bgcolor=c2fc20 align=center>
 
8
    <a href=http://www.pygame.org>
 
9
    <img src=../pygame_tiny.gif border=0 width=200 height=60></a><br>
 
10
    <b>pygame&nbsp;&nbsp;&nbsp;documentation</b>
 
11
</td><td bgcolor=6aee28 align=center valign=top width=100%>
 
12
 
 
13
        ||&nbsp;
 
14
        <a href=http://www.pygame.org>Home</a> &nbsp;||&nbsp;
 
15
        <a href=../index.html>Help Contents</a> &nbsp;||
 
16
        <br>&nbsp;<br>
 
17
 
 
18
|| <a href=pygame.html>pygame</a> || 
 
19
<a href=pygame_cdrom.html>cdrom</a> || 
 
20
<a href=pygame_constants.html>constants</a> || 
 
21
<a href=pygame_display.html>display</a> || 
 
22
<a href=pygame_draw.html>draw</a> || 
 
23
<a href=pygame_event.html>event</a> ||<br>
 
24
|| <a href=pygame_font.html>font</a> || 
 
25
<a href=pygame_image.html>image</a> || 
 
26
<a href=pygame_joystick.html>joystick</a> || 
 
27
<a href=pygame_key.html>key</a> || 
 
28
<a href=pygame_mixer.html>mixer</a> || 
 
29
<a href=pygame_mixer_music.html>mixer_music</a> ||<br>
 
30
|| <a href=pygame_mouse.html>mouse</a> || 
 
31
<a href=pygame_movie.html>movie</a> || 
 
32
<a href=pygame_surfarray.html>surfarray</a> || 
 
33
<a href=pygame_time.html>time</a> || 
 
34
<a href=pygame_transform.html>transform</a> ||<br>
 
35
&nbsp;<br>|| <a href=CD.html>CD</a> || 
 
36
<a href=Channel.html>Channel</a> || 
 
37
<a href=Clock.html>Clock</a> || 
 
38
<a href=Font.html>Font</a> || 
 
39
<a href=Joystick.html>Joystick</a> || 
 
40
<a href=Movie.html>Movie</a> ||<br>
 
41
|| <a href=Rect.html>Rect</a> || 
 
42
<a href=Sound.html>Sound</a> || 
 
43
<a href=Surface.html>Surface</a> ||<br>
 
44
&nbsp;<br>|| <a href=pygame_cursors.html>cursors</a> || 
 
45
<a href=pygame_sprite.html>sprite</a> || 
 
46
<a href=pygame_version.html>version</a> ||<br>
 
47
 
 
48
 
 
49
</td></tr></table></td></tr></table>
 
50
<br>
 
51
<h2 align=center>pygame.joystick</h2>
 
52
The joystick module provides a few functions to initialize
 
53
the joystick subsystem and to manage the Joystick objects. These
 
54
objects are created with the <a href=#Joystick>pygame.joystick.Joystick()</a> function.
 
55
This function needs a joystick device number to work on. All
 
56
joystick devices on the system are enumerated for use as a Joystick
 
57
object. To access most of the Joystick functions, you'll need to
 
58
<a href=pygame.html#init>init()</a> the Joystick. (note that the joystick module will already
 
59
be initialized). When multiple Joysticks objects are created for the
 
60
same joystick device, the state and values for those Joystick objects
 
61
will be shared.
 
62
<br>&nbsp;<br>
 
63
You can call the <a href=Joystick.html#get_name>Joystick.get_name()</a> and <a href=Joystick.html#get_id>Joystick.get_id()</a> functions
 
64
without initializing the Joystick object.
 
65
<br>&nbsp;<br>
 
66
Joystick control values are only updated during the calls to the event
 
67
queue. Call <a href=pygame_event.html#pump>pygame.event.pump()</a> if you are not using the event queue for
 
68
any input handling. Once a joystick object has been initialized, it will
 
69
start to send joystick events to the input queue.
 
70
<br>&nbsp;<br>
 
71
Be sure to understand there is a difference between the joystick module
 
72
and the Joystick objects.
 
73
 
 
74
<hr>
 
75
 
 
76
<table>
 
77
<tr><td><a href=#Joystick>Joystick</a></td><td> -
 
78
create new joystick object</td></tr>
 
79
 
 
80
 
 
81
<tr><td><a href=#get_count>get_count</a></td><td> -
 
82
query number of joysticks on system</td></tr>
 
83
 
 
84
 
 
85
<tr><td><a href=#get_init>get_init</a></td><td> -
 
86
query initialization of joystick module</td></tr>
 
87
 
 
88
 
 
89
<tr><td><a href=#init>init</a></td><td> -
 
90
initialize joystick module</td></tr>
 
91
 
 
92
 
 
93
<tr><td><a href=#quit>quit</a></td><td> -
 
94
uninitialize joystick module</td></tr>
 
95
 
 
96
 
 
97
</table>
 
98
 
 
99
<hr>
 
100
 
 
101
<a name=Joystick><font size=+2><b>Joystick
 
102
</b></font><br><font size=+1><tt>
 
103
pygame.joystick.Joystick(id) -> Joystick
 
104
</tt></font><ul>
 
105
Creates a new joystick object for the given device id. The given id
 
106
must be less than the value from <a href=#get_count>pygame.joystick.get_count()</a>.
 
107
</ul><br>&nbsp;<br>
 
108
 
 
109
<a name=get_count><font size=+2><b>get_count
 
110
</b></font><br><font size=+1><tt>
 
111
pygame.joystick.get_count() -> int
 
112
</tt></font><ul>
 
113
Returns the number of joysticks devices available on
 
114
the system.
 
115
</ul><br>&nbsp;<br>
 
116
 
 
117
<a name=get_init><font size=+2><b>get_init
 
118
</b></font><br><font size=+1><tt>
 
119
pygame.joystick.get_init() -> bool
 
120
</tt></font><ul>
 
121
Returns true when the joystick module is initialized.
 
122
</ul><br>&nbsp;<br>
 
123
 
 
124
<a name=init><font size=+2><b>init
 
125
</b></font><br><font size=+1><tt>
 
126
pygame.joystick.init() -> None
 
127
</tt></font><ul>
 
128
Initialize the joystick module manually
 
129
</ul><br>&nbsp;<br>
 
130
 
 
131
<a name=quit><font size=+2><b>quit
 
132
</b></font><br><font size=+1><tt>
 
133
pygame.joystick.quit() -> None
 
134
</tt></font><ul>
 
135
Uninitialize the joystick module manually
 
136
</ul><br>&nbsp;<br>
 
137
 
 
138
 
 
139
<hr>
 
140
</body></html>