Application Events
Procedure:
(SDL-POLL-EVENT) → '()
C Function Name:
SDL_PollEvent
Notes:
Puts a new event into the library.
Procedure:
(SDL-EVENT-NONE?) → boolean
Returns:
#tif there are no events otherwise#f.
Procedure:
(SDL-EVENT-TIMESTAMP) → number
Returns:
Get the timestamp of an event. All events have a timestamp.
Procedure:
(SDL-EVENT-QUIT?) → boolean
Returns:
#tif event is of typeSDL_QUITotherwise#f.
Procedure:
(SDL-EVENT-CLIPBOARD?) → boolean
Returns:
#tif event is of typeSDL_CLIPBOARDUPDATEotherwise#f.
Procedure:
(SDL-EVENT-TERMINATING?) → boolean
Returns:
#tif event is of typeSDL_APP_TERMINATINGotherwise#f.
Procedure:
(SDL-EVENT-LOW-MEMORY?) → boolean
Returns:
#tif event is of typeSDL_APP_LOWMEMORYotherwise#f.
Procedure:
(SDL-EVENT-WILL-ENTER-BACKGROUND?) → boolean
Returns:
#tif event is of typeSDL_APP_WILLENTERBACKGROUNDotherwise#f.
Procedure:
(SDL-EVENT-DID-ENTER-BACKGROUND?) → boolean
Returns:
#tif event is of typeSDL_APP_DIDENTERBACKGROUNDotherwise#f.
Procedure:
(SDL-EVENT-WILL-ENTER-FOREGROUND?) → boolean
Returns:
#tif event is of typeSDL_APP_WILLENTERFOREGROUNDotherwise#f.
Procedure:
(SDL-EVENT-DID-ENTER-FOREGROUND?) → boolean
Returns:
#tif event is of typeSDL_APP_DIDENTERFOREGROUNDotherwise#f.
Procedure:
(SDL-EVENT-RENDER-TARGET-RESET?) → boolean
Returns:
#tif event is of typeSDL_RENDER_TARGETS_RESETotherwise#f.
Procedure:
(SDL-EVENT-RENDER-DEVICE-RESET?) → boolean
Returns:
#tif event is of typeSDL_RENDER_DEVICE_RESETotherwise#f.
Windowing Events
Procedure:
(SDL-EVENT-WINDOW?) → boolean
Returns:
#tif event is of typeSDL_WINDOWEVENTotherwise#f.
Procedure:
(SDL-EVENT-SYSWM?) → boolean
Returns:
#tif event is of typeSDL_SYSWMEVENTotherwise#f.
Procedure:
(SDL-EVENT-WIN-SHOWN?) → boolean
Returns:
#tif window is shown otherwise#f.
Notes:
Window Event Type:
SDL_WINDOWEVENT_SHOWN
Procedure:
(SDL-EVENT-WIN-HIDDEN?) → boolean
Returns:
#tif window is hidden otherwise#f.
Notes:
Window Event Type:
SDL_WINDOWEVENT_HIDDEN
Procedure:
(SDL-EVENT-WIN-EXPOSED?) → boolean
Returns:
#tif window is exposed otherwise#f.
Notes:
Window Event Type:
SDL_WINDOWEVENT_EXPOSED
Procedure:
(SDL-EVENT-WIN-MOVED?) → boolean
Returns:
#tif window is moved otherwise#f.
Notes:
Window Event Type:
SDL_WINDOWEVENT_MOVED
Procedure:
(SDL-EVENT-WIN-RESIZED?) → boolean
Returns:
#tif window is resized otherwise#f.
Notes:
Window Event Type:
SDL_WINDOWEVENT_RESIZED
Procedure:
(SDL-EVENT-WIN-SIZE-CHANGED?) → boolean
Returns:
#tif window's size changed otherwise#f.
Notes:
Window Event Type:
SDL_WINDOWEVENT_SIZE_CHANGED
Procedure:
(SDL-EVENT-WIN-MINIMIZED?) → boolean
Returns:
#tif window is minimized otherwise#f.
Notes:
Window Event Type:
SDL_WINDOWEVENT_MINIMIZED
Procedure:
(SDL-EVENT-WIN-MAXIMIZED?) → boolean
Returns:
#tif window is maximized otherwise#f.
Notes:
Window Event Type:
SDL_WINDOWEVENT_MAXIMIZED
Procedure:
(SDL-EVENT-WIN-RESTORED?) → boolean
Returns:
#tif window is restored otherwise#f.
Notes:
Window Event Type:
SDL_WINDOWEVENT_RESTORED
Procedure:
(SDL-EVENT-WIN-ENTER?) → boolean
Returns:
#tif mouse entered window otherwise#f.
Notes:
Window Event Type:
SDL_WINDOWEVENT_ENTER
Procedure:
(SDL-EVENT-WIN-LEAVE?) → boolean
Returns:
#tif mouse left window otherwise#f.
Notes:
Window Event Type:
SDL_WINDOWEVENT_LEAVE
Procedure:
(SDL-EVENT-WIN-FOCUS-GAINED?) → boolean
Returns:
#tif keyboard has gained window's focus otherwise#f.
Notes:
Window Event Type:
SDL_WINDOWEVENT_FOCUS_GAINED
Procedure:
(SDL-EVENT-WIN-FOCUS-LOST?) → boolean
Returns:
#tif keyboard has lost window's focus otherwise#f.
Notes:
Window Event Type:
SDL_WINDOWEVENT_FOCUS_LOST
Procedure:
(SDL-EVENT-WIN-CLOSE?) → boolean
Returns:
#tif window is closed otherwise#f.
Notes:
Window Event Type:
SDL_WINDOWEVENT_CLOSE
Procedure:
(SDL-EVENT-WIN-TAKE-FOCUS?) → boolean
Returns:
#tif window is offered focus otherwise#f.
Notes:
Window Event Type:
SDL_WINDOWEVENT_TAKE_FOCUS
Procedure:
(SDL-EVENT-WIN-HIT-TEST?) → boolean
Returns:
#tif window has a special hit test otherwise#f.
Notes:
Window Event Type:
SDL_WINDOWEVENT_HIT_TEST
Procedure:
(SDL-EVENT-WIN-ID) → number
Returns:
The window's id.
Procedure:
(SDL-EVENT-WIN-X) → number
Returns:
The window event's x value.
Procedure:
(SDL-EVENT-WIN-Y) → number
Returns:
The window event's y value.
Procedure:
(SDL-EVENT-WIN-W) → number
Returns:
The window event's width value.
Procedure:
(SDL-EVENT-WIN-H) → number
Returns:
The window event's height value.
Keyboard Events
Procedure:
(SDL-EVENT-KEYUP?) → boolean
Returns:
#tif event is of typeSDL_KEYUPotherwise#f.
Procedure:
(SDL-EVENT-KEYDOWN?) → boolean
Returns:
#tif event is of typeSDL_KEYDOWNotherwise#f.
Procedure:
(SDL-EVENT-KEYMAP-CHANGED?) → boolean
Returns:
#tif event is of typeSDL_KEYMAPCHANGEDotherwise#f.
Procedure:
(SDL-EVENT-KEY-REPEAT?) → boolean
Returns:
#tif key press was repeated otherwise#f.
Procedure:
(SDL-EVENT-KEY-UP? key) → boolean
Parameters:
key : A SDL key code.
Returns:
#tif key was released otherwise#f.
Procedure:
(SDL-EVENT-KEY-DOWN? key) → boolean
Parameters:
key : A SDL key code.
Returns:
#tif key was pressed otherwise#f.
Procedure:
(SDL-EVENT-MOD-UP? key) → boolean
Parameters:
key : A SDL modifier code.
Returns:
#tif key was released otherwise#f.
Procedure:
(SDL-EVENT-MOD-DOWN? key) → boolean
Parameters:
key : A SDL modifier code.
Returns:
#tif key was pressed otherwise#f.
Procedure:
(SDL-EVENT-CODE-UP? key) → boolean
Parameters:
key : A SDL scancode.
Returns:
#tif key was released otherwise#f.
Procedure:
(SDL-EVENT-CODE-DOWN? key) → boolean
Parameters:
key : A SDL scancode.
Returns:
#tif key was pressed otherwise#f.
Text Events
Procedure:
(SDL-EVENT-TEXT-EDITING?) → boolean
Returns:
#tif event is of typeSDL_TEXTEDITINGotherwise#f.
Procedure:
(SDL-EVENT-TEXT-INPUT?) → boolean
Returns:
#tif event is of typeSDL_TEXTINPUTotherwise#f.
Procedure:
(SDL-EVENT-TEXT-EDITING-TEXT) → string
Returns:
The text being edited.
Procedure:
(SDL-EVENT-TEXT-INPUT-TEXT) → string
Returns:
The text being input.
Mouse Events
Procedure:
(SDL-EVENT-MOUSE-MOTION?) → boolean
Returns:
#tif event is of typeSDL_MOUSEMOTIONotherwise#f.
Procedure:
(SDL-EVENT-MOUSE-BUTTON-DOWN?) → boolean
Returns:
#tif event is of typeSDL_MOUSEBUTTONDOWNotherwise#f.
Procedure:
(SDL-EVENT-MOUSE-BUTTON-UP?) → boolean
Returns:
#tif event is of typeSDL_MOUSEBUTTONUPotherwise#f.
Procedure:
(SDL-EVENT-MOUSE-BUTTON-WHEEL?) → boolean
Returns:
#tif event is of typeSDL_MOUSEWHEELotherwise#f.
Procedure:
(SDL-EVENT-MOUSE-MOTION-WHICH) → number
Returns:
The id of the mouse for the motion event.
Procedure:
(SDL-EVENT-MOUSE-MOTION-X) → number
Returns:
The x value of the mouse motion event.
Procedure:
(SDL-EVENT-MOUSE-MOTION-Y) → number
Returns:
The y value of the mouse motion event.
Procedure:
(SDL-EVENT-MOUSE-MOTION-X-REL) → number
Returns:
The relative x value of the mouse motion event.
Procedure:
(SDL-EVENT-MOUSE-MOTION-Y-REL) → number
Returns:
The relative y value of the mouse motion event.
Procedure:
(SDL-EVENT-MOUSE-MOTION-B-LEFT?) → boolean
Returns:
#tif the left mouse button is down otherwise#f.
Procedure:
(SDL-EVENT-MOUSE-MOTION-B-MIDDLE?) → boolean
Returns:
#tif the middle mouse button is down otherwise#f.
Procedure:
(SDL-EVENT-MOUSE-MOTION-B-RIGHT?) → boolean
Returns:
#tif the right mouse button is down otherwise#f.
Procedure:
(SDL-EVENT-MOUSE-MOTION-B-X1?) → boolean
Returns:
#tif the x1 mouse button is down otherwise#f.
Procedure:
(SDL-EVENT-MOUSE-MOTION-B-X2?) → boolean
Returns:
#tif the x2 mouse button is down otherwise#f.
Procedure:
(SDL-EVENT-MOUSE-BUTTON-WHICH) → number
Returns:
The id of the mouse for the button event.
Procedure:
(SDL-EVENT-MOUSE-BUTTON-STATE) → symbol
Returns:
'SDL-RELEASEDor'SDL-PRESSED.
Procedure:
(SDL-EVENT-MOUSE-BUTTON-BUTTON) → symbol
Returns:
SDL-BUTTON-LEFT SDL-BUTTON-MIDDLE SDL-BUTTON-RIGHT SDL-BUTTON-X1 SDL-BUTTON-X2
Procedure:
(SDL-EVENT-MOUSE-BUTTON-CLICKS) → number
Returns:
The number of time there the mouse button has been clicked.
Procedure:
(SDL-EVENT-MOUSE-BUTTON-X) → number
Returns:
The x value of the mouse.
Procedure:
(SDL-EVENT-MOUSE-BUTTON-Y) → number
Returns:
The y value of the mouse.
Procedure:
(SDL-EVENT-MOUSE-WHEEL-WHICH) → number
Returns:
The id of the mouse for the wheel event.
Procedure:
(SDL-EVENT-MOUSE-WHEEL-WHICH) → symbol
Returns:
'SDL-MOUSE-WHEEL-NORMAL,'SDL-MOUSE-WHEEL-FLIPPED.
Procedure:
(SDL-EVENT-WHEEL-BUTTON-X) → number
Returns:
The x value of the mouse.
Procedure:
(SDL-EVENT-WHEEL-BUTTON-Y) → number
Returns:
The y value of the mouse.
Joystick Events
Procedure:
(SDL-EVENT-JOY-DEV-ADDED?) → boolean
Returns:
#tif event is of typeSDL_JOYDEVICEADDEDotherwise#f.
Procedure:
(SDL-EVENT-JOY-DEV-REMOVED?) → boolean
Returns:
#tif event is of typeSDL_JOYDEVICEREMOVEDotherwise#f.
Procedure:
(SDL-EVENT-JOY-DEVICE) → number
Returns:
The id of the joystick device.
Procedure:
(SDL-EVENT-JOY-BUTTON-UP?) → boolean
Returns:
#tif event is of typeSDL_JOYBUTTONUPotherwise#f.
Procedure:
(SDL-EVENT-JOY-BUTTON-DOWN?) → boolean
Returns:
#tif event is of typeSDL_JOYBUTTONDOWNotherwise#f.
Procedure:
(SDL-EVENT-JOY-BUTTON?) → boolean
Returns:
#tif event is of typeSDL_JOYBUTTONUPorSDL_JOYBUTTONDOWNotherwise#f.
Procedure:
(SDL-EVENT-JOY-BUTTON-PRESSED?) → boolean
Returns:
#tif button was pressed down otherwise#f.
Procedure:
(SDL-EVENT-JOY-BUTTON-DEVICE) → number
Returns:
The id of the joystick device.
Procedure:
(SDL-EVENT-JOY-BUTTON) → number
Returns:
The id of the button.
Procedure:
(SDL-EVENT-JOY-HAT?) → boolean
Returns:
#tif event is of typeSDL_JOYHATMOTIONotherwise#f.
Procedure:
(SDL-EVENT-JOY-HAT) → number
Returns:
The id of the hat.
Procedure:
(SDL-EVENT-JOY-HAT-POS) → symbol
Returns:
SDL-HAT-CENTERED SDL-HAT-UP SDL-HAT-RIGHT SDL-HAT-DOWN SDL-HAT-LEFT SDL-HAT-RIGHT-UP SDL-HAT-RIGHT-DOWN SDL-HAT-LEFT-UP SDL-HAT-LEFT-DOWN
Procedure:
(SDL-EVENT-JOY-HAT-DEVICE) → number
Returns:
The id of the joystick device.
Procedure:
(SDL-EVENT-JOY-BALL?) → boolean
Returns:
#tif event is of typeSDL_JOYBALLMOTIONotherwise#f.
Procedure:
(SDL-EVENT-JOY-BALL) → number
Returns:
The id of the ball.
Procedure:
(SDL-EVENT-JOY-BALL-X-REL) → number
Returns:
The motion in the relative x-direction.
Procedure:
(SDL-EVENT-JOY-BALL-Y-REL) → number
Returns:
The motion in the relative y-direction.
Procedure:
(SDL-EVENT-JOY-BALL-DEVICE) → number
Returns:
The id of the joystick device.
Procedure:
(SDL-EVENT-JOY-AXIS?) → boolean
Returns:
#tif event is of typeSDL_JOYAXISMOTIONotherwise#f.
Procedure:
(SDL-EVENT-JOY-AXIS) → number
Returns:
The id of the axis.
Procedure:
(SDL-EVENT-JOY-AXIS-MOTION) → number
Returns:
The current position of the axis.
Procedure:
(SDL-EVENT-JOY-AXIS-DEVICE) → number
Returns:
The id of the joystick device.
Controller Events
Procedure:
(SDL-EVENT-CON-DEV-ADDED?) → boolean
Returns:
#tif event is of typeSDL_CONTROLLERDEVICEADDEDotherwise#f.
Procedure:
(SDL-EVENT-CON-DEV-REMOVED?) → boolean
Returns:
#tif event is of typeSDL_CONTROLLERDEVICEREMOVEDotherwise#f.
Procedure:
(SDL-EVENT-CON-DEV-REMAPPED?) → boolean
Returns:
#tif event is of typeSDL_CONTROLLERDEVICEREMAPPEDotherwise#f.
Procedure:
(SDL-EVENT-CON-DEVICE) → number
Returns:
The id of the game controller.
Procedure:
(SDL-EVENT-CON-AXIS?) → boolean
Returns:
#tif event is of typeSDL_CONTROLLERAXISMOTIONotherwise#f.
Procedure:
(SDL-EVENT-CON-AXIS-DEVICE) → number
Returns:
The id of the game controller.
Procedure:
(SDL-EVENT-CON-AXIS) → symbol
Returns:
SDL-CONTROLLER-AXIS-LEFT-X SDL-CONTROLLER-AXIS-LEFT-Y SDL-CONTROLLER-AXIS-RIGHT-X SDL-CONTROLLER-AXIS-RIGHT-Y SDL-CONTROLLER-AXIS-TRIGGER-LEFT SDL-CONTROLLER-AXIS-TRIGGER-RIGHT
Procedure:
(SDL-EVENT-CON-MOTION) → number
Returns:
The current position of the axis.
Procedure:
(SDL-EVENT-CON-BUTTON-UP?) → boolean
Returns:
#tif event is of typeSDL_CONTROLLERBUTTONUPotherwise#f.
Procedure:
(SDL-EVENT-CON-BUTTON-DOWN?) → boolean
Returns:
#tif event is of typeSDL_CONTROLLERBUTTONDOWNotherwise#f.
Procedure:
(SDL-EVENT-CON-BUTTON?) → boolean
Returns:
#tif event is of typeSDL_CONTROLLERBUTTONUPorSDL_CONTROLLERBUTTONDOWNotherwise#f.
Procedure:
(SDL-EVENT-CON-BUTTON-PRESSED?) → boolean
Returns:
#tif the button is pressed down otherwise#f.
Procedure:
(SDL-EVENT-CON-BUTTON) → symbol
Returns:
SDL-CONTROLLER-BUTTON-A SDL-CONTROLLER-BUTTON-B SDL-CONTROLLER-BUTTON-X SDL-CONTROLLER-BUTTON-Y SDL-CONTROLLER-BUTTON-BACK SDL-CONTROLLER-BUTTON-GUIDE SDL-CONTROLLER-BUTTON-START SDL-CONTROLLER-BUTTON-LEFT-STICK SDL-CONTROLLER-BUTTON-RIGHT-STICK SDL-CONTROLLER-BUTTON-LEFT-SHOULDER SDL-CONTROLLER-BUTTON-RIGHT-SHOULDER SDL-CONTROLLER-BUTTON-UP SDL-CONTROLLER-BUTTON-DOWN SDL-CONTROLLER-BUTTON-LEFT SDL-CONTROLLER-BUTTON-RIGHT
Procedure:
(SDL-EVENT-CON-BUTTON-DEVICE) → number
Returns:
The id of the game controller.
Audio Events
Procedure:
(SDL-EVENT-AUDIO-DEVICE-ADDED?) → boolean
Returns:
#tif event is of typeSDL_AUDIODEVICEADDEDotherwise#f.
Procedure:
(SDL-EVENT-AUDIO-DEVICE-REMOVED?) → boolean
Returns:
#tif event is of typeSDL_AUDIODEVICEREMOVEDotherwise#f.
Procedure:
(SDL-EVENT-AUDIO-DEVICE-WHICH) → number
Returns:
The id of the audio device.
Procedure:
(SDL-EVENT-AUDIO-DEVICE-ISCAPTURE?) → boolean
Returns:
#tif the device is a capture device otherwise#f.
Touch Events
Procedure:
(SDL-EVENT-FINGER-DOWN?) → boolean
Returns:
#tif event is of typeSDL_FINGERDOWNotherwise#f.
Procedure:
(SDL-EVENT-FINGER-UP?) → boolean
Returns:
#tif event is of typeSDL_FINGERUPotherwise#f.
Procedure:
(SDL-EVENT-FINGER-MOTION?) → boolean
Returns:
#tif event is of typeSDL_FINGERMOTIONotherwise#f.
Procedure:
(SDL-EVENT-DOLLAR-GESTURE?) → boolean
Returns:
#tif event is of typeSDL_DOLLARGESTUREotherwise#f.
Procedure:
(SDL-EVENT-DOLLAR-RECORD?) → boolean
Returns:
#tif event is of typeSDL_DOLLARRECORDotherwise#f.
Procedure:
(SDL-EVENT-MULTI-GESTURE?) → boolean
Returns:
#tif event is of typeSDL_MULTIGESTUREotherwise#f.
Procedure:
(SDL-EVENT-TOUCH-ID) → number
Returns:
The id of the touch device.
Procedure:
(SDL-EVENT-TOUCH-X) → number
Returns:
The x-axis location of the touch event, normalized (0...1)
Procedure:
(SDL-EVENT-TOUCH-Y) → number
Returns:
The y-axis location of the touch event, normalized (0...1)
Procedure:
(SDL-EVENT-TOUCH-DX) → number
Returns:
The distance moved in the x-axis, normalized (0...1)
Procedure:
(SDL-EVENT-TOUCH-DY) → number
Returns:
The distance moved in the y-axis, normalized (0...1)
Procedure:
(SDL-EVENT-TOUCH-PRESSURE) → number
Returns:
The quantity of pressure applied, normalized (0...1)
Procedure:
(SDL-EVENT-FINGER-ID) → number
Returns:
The id of the finger.
Procedure:
(SDL-EVENT-GESTURE-ID) → number
Returns:
The id of the gesture.
Procedure:
(SDL-EVENT-GESTURE-NUM-FINGERS) → number
Returns:
The number of fingers used to draw the stroke.
Procedure:
(SDL-EVENT-GESTURE-ERROR) → number
Returns:
The difference between the gesture template and the actual performed gesture.
Procedure:
(SDL-EVENT-MULTI-GESTURE-DTHETA) → number
Returns:
The amount that the fingers rotated during this motion.
Procedure:
(SDL-EVENT-MULTI-GESTURE-DDIST) → number
Returns:
The amount that the fingers pinched during this motion.
Drag & Drop Events
Procedure:
(SDL-EVENT-DROP-FILE?) → boolean
Returns:
#tif event is of typeSDL_DROPFILEotherwise#f.
Procedure:
(SDL-EVENT-DROP-TEXT?) → boolean
Returns:
#tif event is of typeSDL_DROPTEXTotherwise#f.
Procedure:
(SDL-EVENT-DROP-BEGIN?) → boolean
Returns:
#tif event is of typeSDL_DROPBEGINotherwise#f.
Procedure:
(SDL-EVENT-DROP-COMPLETE?) → boolean
Returns:
#tif event is of typeSDL_DROPCOMPLETEotherwise#f.
Procedure:
(SDL-EVENT-DROP-FILE) → string
Returns:
The file name.