forked from xwiimote/xwiimote-bindings
-
Notifications
You must be signed in to change notification settings - Fork 0
/
binding_api.txt
253 lines (216 loc) · 4.35 KB
/
binding_api.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
Package name : xwiimote
valid for: python & perl
see xwiimote.h for more documentation.
I) Constants :
1) Strings to define the hardware
NAME_CORE
NAME_ACCEL
NAME_IR
NAME_MOTION_PLUS
NAME_NUNCHUK
NAME_CLASSIC_CONTROLLER
NAME_BALANCE_BOARD
NAME_PRO_CONTROLLER
NAME_DRUMS
NAME_GUITAR
2) event_types enumeration
EVENT_KEY
EVENT_ACCEL
EVENT_IR
EVENT_BALANCE_BOARD
EVENT_BALANCE_BOARD_KEY
EVENT_MOTION_PLUS
EVENT_PRO_CONTROLLER_KEY
EVENT_PRO_CONTROLLER_MOVE
EVENT_WATCH
EVENT_CLASSIC_CONTROLLER_KEY
EVENT_CLASSIC_CONTROLLER_MOVE
EVENT_NUNCHUK_KEY
EVENT_NUNCHUK_MOVE
EVENT_DRUMS_KEY
EVENT_DRUMS_MOVE
EVENT_GUITAR_KEY
EVENT_GUITAR_MOVE
EVENT_GONE
EVENT_NUM
3) event_keys enumeration
KEY_LEFT
KEY_RIGHT
KEY_UP
KEY_DOWN
KEY_A
KEY_B
KEY_PLUS
KEY_MINUS
KEY_HOME
KEY_ONE
KEY_TWO
KEY_X
KEY_Y
KEY_TL
KEY_TR
KEY_ZL
KEY_ZR
KEY_THUMBL
KEY_THUMBR
KEY_C
KEY_Z
KEY_STRUM_BAR_UP
KEY_STRUM_BAR_DOWN
KEY_FRET_FAR_UP
KEY_FRET_UP
KEY_FRET_MID
KEY_FRET_LOW
KEY_FRET_FAR_LOW
KEY_NUM
4) drums_abs enumeration
DRUMS_ABS_PAD
DRUMS_ABS_CYMBAL_LEFT
DRUMS_ABS_CYMBAL_RIGHT
DRUMS_ABS_TOM_LEFT
DRUMS_ABS_TOM_RIGHT
DRUMS_ABS_TOM_FAR_RIGHT
DRUMS_ABS_BASS
DRUMS_ABS_HI_HAT
DRUMS_ABS_NUM
5) iface_type enumeration
IFACE_CORE
IFACE_ACCEL
IFACE_IR
IFACE_MOTION_PLUS
IFACE_NUNCHUK
IFACE_CLASSIC_CONTROLLER
IFACE_BALANCE_BOARD
IFACE_PRO_CONTROLLER
IFACE_DRUMS
IFACE_GUITAR
IFACE_ALL
IFACE_WRITABLE
6) led enumeration
LED1
LED2
LED3
LED4
II) Classes
1) event
members: type (event_types)
methods:
1.1) evt event()
input: none
output: evt (event)
exceptions: none related to xwiimote
1.2) (x, y, z) get_abs(abs_num)
input: none
output: x (integer), y (integer), z (integer)
exceptions: ValueError
1.3) set_abs(n, x, y, z)
input: abs_num (integer), x (integer), y (integer), z (integer)
output: none
exceptions: ValueError
1.4) (code, state) get_key()
input: none
output: code (event_keys), state (integer)
exceptions: none
1.5) set_key(code, state)
input: code (integer), state (integer)
output: none
exceptions: none
1.6) (tv_sec, tv_usec) get_time()
input: none
output: tv_sec (integer), tv_usec (integer)
exceptions: none
1.7) set_time(tv_sec, tv_usec)
input: tv_sec (integer), tv_usec (integer)
output: none
exceptions: none
1.8) (validity) ir_is_valid(abs_num)
input: abs_num (integer)
output: validity (boolean)
exceptions: ValueError
2) iface
members: none
methods :
2.1) (ifc) iface(syspath)
input: syspath (string)
output: ifc (iface)
exceptions: IOError (errno is filled)
comment : alike the c api, this automatically set watch to true
2.2) open(ifaces)
input: ifaces (integer)
output: none
exceptions: IOError (errno is filled)
2.3) close(ifaces)
input: ifaces (integer)
output: none
exceptions: none
2.4) (ifaces) opened()
input: none
output: ifaces (integer)
exceptions: none
2.5) (syspath) get_syspath()
input: none
output: syspath (string)
exceptions: IOError
2.6) (fd) get_fd()
input: none
output: fd (integer)
exceptions: none
2.7) (ifaces) available()
input: none
output: ifaces (integer)
exceptions: none
2.8) dispatch(ev)
input: ev (event)
output: none
exceptions: IOError (errno is filled)
2.9) rumble(on)
input: on (boolean)
output: none
exceptions: IOError (errno is filled)
2.10) (state) get_led(led)
input: led (integer)
output: state (boolean)
exceptions: IOError (errno is filled), ValueError
2.11) set_led(led, state)
input: led (integer), state (boolean)
output: none
exceptions: IOError (errno is filled), ValueError
2.12) (capacity) get_battery()
input: none
output: capacity (integer)
exceptions: IOError (errno is filled)
2.13) (devtype) get_devtype()
input: none
output: devtype (string)
exceptions: IOError (errno is filled)
2.14) (extension) get_extension()
input: none
output: extension (string)
exceptions: IOError (errno is filled)
2.15) set_mp_normalization(x, y, z, factor)
input: x (integer), y (integer), z (integer), factor (integer)
output: none
exceptions: none
2.16) (x, y, z, factor) get_mp_normalization()
input: none
output: x (integer), y (integer), z (integer), factor (integer)
exceptions: none
2.17) static (name) get_name(type)
input: type (iface_type)
output: name (string)
exceptions: none
3) monitor
members: none
methods:
3.1) (mon) monitor(poll, direct)
input: poll (boolean), direct (boolean)
output: mon (monitor)
exceptions: SystemError
3.2) (fd) get_fd(blocking)
input: blocking (boolean)
output: fd (integer)
exceptions: SystemError
3.3) (dev) poll()
input: none
output: dev (string)
exceptions: none