SDL Event: Unterschied zwischen den Versionen
Aus DGL Wiki
(→Beschreibung) |
I0n0s (Diskussion | Beiträge) K (type->type_) |
||
| Zeile 8: | Zeile 8: | ||
== Delphi-Spezifikation == | == Delphi-Spezifikation == | ||
type '''SDL_Event''' = record | type '''SDL_Event''' = record | ||
| − | '' | + | ''type_'' : Uint8; |
''active'' : SDL_ActiveEvent; | ''active'' : SDL_ActiveEvent; | ||
''key'' : SDL_KeyboardEvent; | ''key'' : SDL_KeyboardEvent; | ||
| Zeile 29: | Zeile 29: | ||
{| border="1" rules="all" | {| border="1" rules="all" | ||
| − | !'' | + | !''type_'' |
|Die Art des Ereignisses | |Die Art des Ereignisses | ||
|- | |- | ||
| Zeile 84: | Zeile 84: | ||
| − | Für '' | + | Für ''type_'' existieren folgende symbolische Werte: |
{| border="1" rules="all" | {| border="1" rules="all" | ||
!SDL_ACTIVEEVENT | !SDL_ACTIVEEVENT | ||
Version vom 1. September 2005, 16:15 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.