SDL Event: Unterschied zwischen den Versionen
Aus DGL Wiki
(→Parameter) |
(→Beschreibung) |
||
| Zeile 76: | Zeile 76: | ||
== Beschreibung == | == Beschreibung == | ||
| − | SDL_Event ist der Kern | + | 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: | SDL_Event wird benutzt um: | ||
| Zeile 126: | Zeile 126: | ||
|} | |} | ||
<br> | <br> | ||
| − | |||
== Beispiel == | == Beispiel == | ||
Version vom 1. September 2005, 13:54 Uhr
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.