SDL Event: Unterschied zwischen den Versionen
Aus DGL Wiki
I0n0s (Diskussion | Beiträge) () |
Flash (Diskussion | Beiträge) K () |
||
| Zeile 7: | Zeile 7: | ||
<br> | <br> | ||
== Delphi-Spezifikation == | == Delphi-Spezifikation == | ||
| − | type '''SDL_Event'''=record | + | 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; | end; | ||
Version vom 28. August 2005, 01:36 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 | Aktivations Ereignis (siehe SDL_ActiveEvent) |
| key | Keyboard Ereignis (siehe SDL_KeyboardEvent) |
| motion | Mausbewegung Ereignis (siehe SDL_MouseMotionEvent) |
| button | Mausknopf Ereignis (siehe SDL_MouseButtonEvent) |
| jaxis | Joystick Achse Bewegung Ereignis (siehe SDL_JoyAxisEvent) |
| jball | Joystick Trackball Bewegung Ereignis (siehe SDL_JoyBallEvent) |
| jhat | Joystick Hat Bewegung Ereignis (siehe SDL_JoyHatEvent) |
| jbutton | Joystick Knopf Ereignis (siehe SDL_JoyButtonEvent) |
| resize | Anwendungsfenster Grösse Änderungs Ereignis (siehe SDL_ResizeEvent) |
| expose | Externe Auflösungsänderung Ereignis (siehe SDL_ExposeEvent) |
| quit | Anwendung Schliessen Nachfrage Ereignis (siehe SDL_QuitEvent) |
| user | Benutzer definiertes Ereignis (sieheSDL_UserEvent) |
| syswm | Undefiniertes Fenstermanager Ereignis (sieheSDL_SysWMEvent) |
Beschreibung
SDL_Event ist der Kern von aller Ereignisbehandlung in SDL, für OpenGLer 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.
Hinweise
Als typ sind folgende Konstanten vorgesehen:
| 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.