SDL_events.h
Estructura SDL_KeyboardEvent
Una estructura que contiene información de eventos de botón de teclado.
typedef struct SDL_KeyboardEvent { Uint32 type; /**< ::SDL_KEYDOWN or ::SDL_KEYUP */ Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ Uint32 windowID; /**< The window with keyboard focus, if any */ Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */ Uint8 repeat; /**< Non-zero if this is a key repeat */ Uint8 padding2; Uint8 padding3; SDL_Keysym keysym; /**< The key that was pressed or released */ } SDL_KeyboardEvent;
Miembros
- type
- El tipo de evento; SDL_KEYDOWN o SDL_KEYUP.
- timestamp
- Marca de tiempo en milisegundos.
- windowID
- La ventana con el foco del teclado, si hay alguna.
- state
- El estado de la tecla; SDL_PRESSED o SDL_RELEASED.
- repeat
- Distinto de cero si se trata de una repetición de tecla.
- keysym
- El SDL_Keysym que representa la tecla que ha sido pulsada o liberada.
Observaciones
SDL_KeyboardEvent es un miembro de la unión SDL_Event y se utiliza cuando se reporta un evento de tipo SDL_KEYDOWN o SDL_KEYUP. Se accede a él a través del campo key del evento.
Un evento SDL_KEYDOWN o SDL_KEYUP se produce siempre que un usuario pulsa o suelta una tecla de un teclado. La información sobre qué tecla se ha pulsado o soltado se encuentra en el miembro keysym.