From 966088f4880cbb5b160305fa0a09b88cde491d6e Mon Sep 17 00:00:00 2001 From: u-an-i <84718885+u-an-i@users.noreply.github.com> Date: Sun, 22 Oct 2023 14:19:47 +0000 Subject: [PATCH] SDL2/SDL_CreateWindow: note about mouse focus and event Live page is here: https://wiki.libsdl.org/SDL2/SDL_CreateWindow --- SDL2/SDL_CreateWindow.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/SDL2/SDL_CreateWindow.md b/SDL2/SDL_CreateWindow.md index 05c576d38..df8f61efd 100644 --- a/SDL2/SDL_CreateWindow.md +++ b/SDL2/SDL_CreateWindow.md @@ -95,6 +95,13 @@ On non-Apple devices, SDL requires you to either not link to the Vulkan loader or link to a dynamic library version. This limitation may be removed in a future version of SDL. +Additionally, a newly created window might not have mouse focus (but keyboard +focus only). By default, SDL will ignore mouse clicks that activate a window, +for its events queue thus a click in a newly created / out of focus window will +not create an event. +Use `SDL_SetHint(SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH, "1");` to override this and +to receive an event from [SDL_PollEvent](SDL_PollEvent)() in such case. + ## Version This function is available since SDL 2.0.0.