SDL_events.h
Estructura SDL_JoyButtonEvent
Una estructura que contiene información de eventos de botones de joystick.
typedef struct SDL_JoyButtonEvent { Uint32 type; /**< ::SDL_JOYBUTTONDOWN or ::SDL_JOYBUTTONUP */ Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ SDL_JoystickID which; /**< The joystick instance id */ Uint8 button; /**< The joystick button index */ Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */ Uint8 padding1; Uint8 padding2; } SDL_JoyButtonEvent;
Miembros
- type
- SDL_JOYBUTTONDOWN o SDL_JOYBUTTONUP
- timestamp
- Marca de tiempo en milisegundos.
- which
- El id de instancia del joystick que notificó el evento.
- button
- El índice del botón que ha cambiado.
- state
- El estado del botón; SDL_PRESSED o SDL_RELEASED.
Observaciones
SDL_JoyButtonEvent es un miembro de la unión SDL_Event y se utiliza cuando se reporta un evento de tipo SDL_JOYBUTTONDOWN o SDL_JOYBUTTONUP. Se accede a él a través del campo jbutton del evento.
Un evento SDL_JOYBUTTONDOWN o SDL_JOYBUTTONUP ocurre cada vez que un usuario presiona o suelta un botón en un joystick.