logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

SDL_Event - The structure for all events in SDL.

Availability

       This struct is available since SDL 3.2.0.

Simple Directmedia Layer                           SDL 3.2.20                                   SDL_Event(3type)

Description

       The  SDL_Event  structure  is  the  core of all event handling in SDL.  SDL_Event is a union of all event
       structures used in SDL.

Name

       SDL_Event - The structure for all events in SDL.

Synopsis

#include<SDL3/SDL_events.h>typedefunionSDL_Event{Uint32type;/**<Eventtype,sharedwithallevents,Uint32tocoverusereventswhicharenotintheSDL_EventTypeenumeration*/SDL_CommonEventcommon;/**<Commoneventdata*/SDL_DisplayEventdisplay;/**<Displayeventdata*/SDL_WindowEventwindow;/**<Windoweventdata*/SDL_KeyboardDeviceEventkdevice;/**<Keyboarddevicechangeeventdata*/SDL_KeyboardEventkey;/**<Keyboardeventdata*/SDL_TextEditingEventedit;/**<Texteditingeventdata*/SDL_TextEditingCandidatesEventedit_candidates;/**<Texteditingcandidateseventdata*/SDL_TextInputEventtext;/**<Textinputeventdata*/SDL_MouseDeviceEventmdevice;/**<Mousedevicechangeeventdata*/SDL_MouseMotionEventmotion;/**<Mousemotioneventdata*/SDL_MouseButtonEventbutton;/**<Mousebuttoneventdata*/SDL_MouseWheelEventwheel;/**<Mousewheeleventdata*/SDL_JoyDeviceEventjdevice;/**<Joystickdevicechangeeventdata*/SDL_JoyAxisEventjaxis;/**<Joystickaxiseventdata*/SDL_JoyBallEventjball;/**<Joystickballeventdata*/SDL_JoyHatEventjhat;/**<Joystickhateventdata*/SDL_JoyButtonEventjbutton;/**<Joystickbuttoneventdata*/SDL_JoyBatteryEventjbattery;/**<Joystickbatteryeventdata*/SDL_GamepadDeviceEventgdevice;/**<Gamepaddeviceeventdata*/SDL_GamepadAxisEventgaxis;/**<Gamepadaxiseventdata*/SDL_GamepadButtonEventgbutton;/**<Gamepadbuttoneventdata*/SDL_GamepadTouchpadEventgtouchpad;/**<Gamepadtouchpadeventdata*/SDL_GamepadSensorEventgsensor;/**<Gamepadsensoreventdata*/SDL_AudioDeviceEventadevice;/**<Audiodeviceeventdata*/SDL_CameraDeviceEventcdevice;/**<Cameradeviceeventdata*/SDL_SensorEventsensor;/**<Sensoreventdata*/SDL_QuitEventquit;/**<Quitrequesteventdata*/SDL_UserEventuser;/**<Customeventdata*/SDL_TouchFingerEventtfinger;/**<Touchfingereventdata*/SDL_PenProximityEventpproximity;/**<Penproximityeventdata*/SDL_PenTouchEventptouch;/**<Pentiptouchingeventdata*/SDL_PenMotionEventpmotion;/**<Penmotioneventdata*/SDL_PenButtonEventpbutton;/**<Penbuttoneventdata*/SDL_PenAxisEventpaxis;/**<Penaxiseventdata*/SDL_RenderEventrender;/**<Rendereventdata*/SDL_DropEventdrop;/**<Draganddropeventdata*/SDL_ClipboardEventclipboard;/**<Clipboardeventdata*//*ThisisnecessaryforABIcompatibilitybetweenVisualC++andGCC.VisualC++willrespectthepushpackpragmaanduse52bytes(sizeofSDL_TextEditingEvent,thelargeststructurefor32-bitand64-bitarchitectures)forthisunion,andGCCwillusethealignmentofthelargestdatatypewithintheunion,whichis8byteson64-bitarchitectures.So...we'lladdpaddingtoforcethesizetobethesameforboth.Onarchitectureswherepointersare16bytes,thisneedsroundinguptothenextmultipleof16,64,andonarchitectureswherepointersareevenlargerthesizeofSDL_UserEventwilldominateasbeing3pointers.*/Uint8padding[128];}SDL_Event;

See Also