Home | History | Annotate | Download | only in darwin

Lines Matching refs:joystick

26 /* SDL joystick driver for Darwin / Mac OS X, based on the IOKit HID API */
566 * Joystick 0 should be the system default joystick.
583 SDL_SetError("Joystick: Device list already inited.");
590 SDL_SetError("Joystick: IOMasterPort error with bootstrap_port.");
598 /* Add key for device type (joystick, in this case) to refine the matching dictionary. */
613 SDL_SetError("Joystick: Failed to get HID CFMutableDictionaryRef via IOServiceMatching.");
622 SDL_SetError("Joystick: Couldn't create a HID object iterator.");
682 /* Function to get the device-dependent name of a joystick */
693 /* Function to open a joystick for use.
694 * The joystick to open is specified by the index field of the joystick.
695 * This should fill the nbuttons and naxes fields of the joystick structure.
698 int SDL_SYS_JoystickOpen(SDL_Joystick *joystick)
703 for (index = joystick->index; index > 0; index--)
706 joystick->hwdata = device;
707 joystick->name = device->product;
709 joystick->naxes = device->axes;
710 joystick->nhats = device->hats;
711 joystick->nballs = 0;
712 joystick->nbuttons = device->buttons;
717 /* Function to update the state of a joystick - called as a device poll.
718 * This function shouldn't update the joystick structure directly,
720 * and update joystick device state.
722 void SDL_SYS_JoystickUpdate(SDL_Joystick *joystick)
724 recDevice *device = joystick->hwdata;
737 SDL_PrivateJoystickAxis(joystick, i, 0);
740 SDL_PrivateJoystickButton(joystick, i, 0);
743 SDL_PrivateJoystickHat(joystick, i, SDL_HAT_CENTERED);
754 if ( value != joystick->axes[i] )
755 SDL_PrivateJoystickAxis(joystick, i, value);
767 if ( value != joystick->buttons[i] )
768 SDL_PrivateJoystickButton(joystick, i, value);
818 if ( pos != joystick->hats[i] )
819 SDL_PrivateJoystickHat(joystick, i, pos);
827 /* Function to close a joystick after use */
828 void SDL_SYS_JoystickClose(SDL_Joystick *joystick)
834 /* Function to perform any system-specific joystick related cleanup */