Lines Matching refs:joystick

27     MacOS joystick functions by Frederick Reitberger
62 * Joystick 0 should be the system default joystick.
129 /* Function to get the device-dependent name of a joystick */
146 /* Function to open a joystick for use.
147 The joystick to open is specified by the index field of the joystick.
148 This should fill the nbuttons and naxes fields of the joystick structure.
151 int SDL_SYS_JoystickOpen(SDL_Joystick *joystick)
161 index = joystick->index;
164 joystick->hwdata = (struct joystick_hwdata *) SDL_malloc(sizeof(*joystick->hwdata));
165 if (joystick->hwdata == NULL)
170 SDL_memset(joystick->hwdata, 0, sizeof(*joystick->hwdata));
171 SDL_strlcpy(joystick->hwdata->name, SDL_SYS_JoystickName(index), SDL_arraysize(joystick->hwdata->name));
172 joystick->name = joystick->hwdata->name;
179 joystick->hwdata->refs);
190 &(joystick->hwdata->refs[count2]));
201 &(joystick->hwdata->refs[count2]));
207 joystick->naxes = numAxis;
208 joystick->nhats = numHats;
209 joystick->nballs = numBalls;
210 joystick->nbuttons = numButtons;
219 /* Function to update the state of a joystick - called as a device poll.
220 * This function shouldn't update the joystick structure directly,
222 * and update joystick device state.
224 void SDL_SYS_JoystickUpdate(SDL_Joystick *joystick)
232 for(i = 0, j = 0; i < joystick->naxes; i++, j++)
237 joystick->hwdata->refs[j],
240 if ( value != joystick->axes[i] ) {
241 SDL_PrivateJoystickAxis(joystick, i, value);
245 for(i = 0; i < joystick->nhats; i++, j++)
250 joystick->hwdata->refs[j],
281 if ( pos != joystick->hats[i] ) {
282 SDL_PrivateJoystickHat(joystick, i, pos);
286 for(i = 0; i < joystick->nballs; i++, j++)
291 for(i = 0; i < joystick->nbuttons; i++, j++)
294 joystick->hwdata->refs[j],
296 if ( d != joystick->buttons[i] ) {
297 SDL_PrivateJoystickButton(joystick, i, d);
302 /* Function to close a joystick after use */
303 void SDL_SYS_JoystickClose(SDL_Joystick *joystick)
307 index = joystick->index;
314 /* Function to perform any system-specific joystick related cleanup */