SDL Wiki
[ front page | index | search | recent changes | git repo | offline html ]

SDL_SetWindowMousePassthrough

Enable or disable mouse passthrough for a window.

Header File

Defined in <SDL3/SDL_video.h>

Syntax

bool SDL_SetWindowMousePassthrough(SDL_Window *window, bool passthrough);

Function Parameters

SDL_Window * window the window to set mouse passthrough for.
bool passthrough true to make the window transparent to mouse input, false to accept mouse input.

Return Value

(bool) Returns true on success or false on failure; call SDL_GetError() for more information.

Remarks

This will add or remove the window's SDL_WINDOW_MOUSE_PASSTHROUGH flag.

When enabled, the window will lose mouse focus and will not get any further mouse, pen, or touch events (except release events for buttons held down at the time) and clicks in the window will go through and hit windows behind it.

Thread Safety

This function should only be called on the main thread.

Version

This function is available since SDL 3.6.0.


CategoryAPI, CategoryAPIFunction, CategoryVideo


[ edit | delete | history | feedback | raw ]

All wiki content is licensed under Creative Commons Attribution 4.0 International (CC BY 4.0).
Wiki powered by ghwikipp.