SDL Event
Aus DGL Wiki
Inhaltsverzeichnis
SDL_Event
Name
SDL_Event - Generelle Event Struktur
Delphi-Spezifikation
type SDL_Event = record
type_ : Uint8;
active : SDL_ActiveEvent;
key : SDL_KeyboardEvent;
motion : SDL_MouseMotionEvent;
button : SDL_MouseButtonEvent;
jaxis : SDL_JoyAxisEvent;
jball : SDL_JoyBallEvent;
jhat : SDL_JoyHatEvent;
jbutton : SDL_JoyButtonEvent;
resize : SDL_ResizeEvent;
expose : SDL_ExposeEvent;
quit : SDL_QuitEvent;
user : SDL_UserEvent;
syswm : SDL_SysWMEvent;
end;
Parameter
| type_ | Die Art des Ereignisses |
|---|---|
| active | Aktivierungs-Ereignis (siehe SDL_ActiveEvent) |
| key | Keyboard-Ereignis (siehe SDL_KeyboardEvent) |
| motion | Mausbewegung-Ereignis (siehe SDL_MouseMotionEvent) |
| button | Mausknopf-Ereignis (siehe SDL_MouseButtonEvent) |
| jaxis | Joystick-Achsenbewegungs-Ereignis (siehe SDL_JoyAxisEvent) |
| jball | Joystick-Trackballbewegungs-Ereignis (siehe SDL_JoyBallEvent) |
| jhat | Joystick-Hatbewegungs-Ereignis (siehe SDL_JoyHatEvent) |
| jbutton | Joystick-Knopf-Ereignis (siehe SDL_JoyButtonEvent) |
| resize | Anwendungsfenster-Grössenänderungs-Ereignis (siehe SDL_ResizeEvent) |
| expose | Externe-Auflösungsänderungs-Ereignis (siehe SDL_ExposeEvent) |
| quit | Anwendungs-Schliessen-Nachfrage-Ereignis (siehe SDL_QuitEvent) |
| user | Benutzerdefiniertes-Ereignis (sieheSDL_UserEvent) |
| syswm | Undefiniertes Fenstermanager-Ereignis (sieheSDL_SysWMEvent) |
Beschreibung
SDL_Event ist der Kern der Ereignisbehandlung in SDL und somit für Nutzer von OpenGL unter SDL die wichtigste Struktur in SDL.
SDL_Event wird benutzt um:
- Ereignisse auszulesen
- Ereignisse geschehen zu lassen
Um ein Ereignis zu lesen benutzt man SDL_PollEvent oder SDL_PeepEvent.
Für type_ existieren folgende symbolische Werte:
| SDL_ACTIVEEVENT | SDL_ActiveEvent |
|---|---|
| SDL_KEYDOWN/UP | SDL_KeyboardEvent |
| SDL_MOUSEMOTION | SDL_MouseMotionEvent |
| SDL_MOUSEBUTTONDOWN/UP | SDL_MouseButtonEvent |
| SDL_JOYAXISMOTION | SDL_JoyAxisEvent |
| SDL_JOYBALLMOTION | SDL_JoyBallEvent |
| SDL_JOYHATMOTION | SDL_JoyHatEvent |
| SDL_JOYBUTTONDOWN/UP | SDL_JoyButtonEvent |
| SDL_QUIT | SDL_QuitEvent |
| SDL_SYSWMEVENT | SDL_SysWMEvent |
| SDL_VIDEORESIZE | SDL_ResizeEvent |
| SDL_VIDEOEXPOSE | SDL_ExposeEvent |
| SDL_USEREVENT | SDL_UserEvent |
Beispiel
Siehe SDL_PollEvent Beispiel.