Repository: libsdl-org/SDL
File: src/video/windows/SDL_windowsvideo.c (C)

Code before:
#endif

// #define HIGHDPI_DEBUG

// Initialization/Query functions
static bool WIN_VideoInit(SDL_VideoDevice *_this);
static void WIN_VideoQuit(SDL_VideoDevice *_this);

// Hints
bool g_WindowsEnableMessageLoop = true;
bool g_WindowsEnableMenuMnemonics = false;
bool g_WindowFrameUsableWhileCursorHidden = true;

static void SDLCALL UpdateWindowsRawKeyboard(void *userdata, const char *name, const char *oldValue, const char *newValue)
{
    SDL_VideoDevice *_this = (SDL_VideoDevice *)userdata;
    bool enabled = SDL_GetStringBoolean(newValue, false);
    WIN_SetRawKeyboardEnabled(_this, enabled);
}

static void SDLCALL UpdateWindowsRawKeyboardNoHotkeys(void *userdata, const char *name, const char *oldValue, const char *newValue)
{
    SDL_VideoDevice *_this = (SDL_VideoDevice *)userdata;
    SDL_VideoData *data = _this->internal;
    data->raw_keyboard_flag_nohotkeys = SDL_GetStringBoolean(newValue, false);
    WIN_SetRawKeyboardEnabled(_this, data->raw_keyboard_enabled);
}


static void SDLCALL UpdateWindowsEnableMessageLoop(void *userdata, const char *name, const char *oldValue, const char *newValue)
{
    g_WindowsEnableMessageLoop = SDL_GetStringBoolean(newValue, true);
}

static void SDLCALL UpdateWindowsEnableMenuMnemonics(void *userdata, const char *name, const char *oldValue, const char *newValue)
{
    g_WindowsEnableMenuMnemonics = SDL_GetStringBoolean(newValue, false);
}

static void SDLCALL UpdateWindowFrameUsableWhileCursorHidden(void *userdata, const char *name, const char *oldValue, const char *newValue)
{
    g_WindowFrameUsableWhileCursorHidden = SDL_GetStringBoolean(newValue, true);
}

#if !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES)
static bool WIN_SuspendScreenSaver(SDL_VideoDevice *_this)
{
    DWORD result;
    if (_this->suspend_screensaver) {
        result = SetThreadExecutionState(ES_CONTINUOUS | ES_DISPLAY_REQUIRED);
    } else {

Review comment (suggestion):
I'm personally not too happy with this calling into the existing logic like this. The existing `internal` `raw_keyboard_*` flags are all set in `SDL_windowsrawinput.c`, I think it's probably best to follow existing patterns and add `WIN_SetRawKeyboardNoHotkeys()`, it'll lead to less confusion in the future.

And when you add `WIN_SetRawKeyboardNoHotkeys()`, you'll notice a call to it is missing from `WIN_VideoQuit()`.

Code after:
#endif

// #define HIGHDPI_DEBUG

// Initialization/Query functions
static bool WIN_VideoInit(SDL_VideoDevice *_this);
static void WIN_VideoQuit(SDL_VideoDevice *_this);

// Hints
bool g_WindowsEnableMessageLoop = true;
bool g_WindowsEnableMenuMnemonics = false;
bool g_WindowFrameUsableWhileCursorHidden = true;

static void SDLCALL UpdateWindowsRawKeyboard(void *userdata, const char *name, const char *oldValue, const char *newValue)
{
    SDL_VideoDevice *_this = (SDL_VideoDevice *)userdata;
    bool enabled = SDL_GetStringBoolean(newValue, false);
    WIN_SetRawKeyboardEnabled(_this, enabled);
}

static void SDLCALL UpdateWindowsRawKeyboardNoHotkeys(void *userdata, const char *name, const char *oldValue, const char *newValue)
{
    SDL_VideoDevice *_this = (SDL_VideoDevice *)userdata;
    bool enabled = SDL_GetStringBoolean(newValue, false);
    WIN_SetRawKeyboardFlag_NoHotkeys(_this, enabled);
}

static void SDLCALL UpdateWindowsEnableMessageLoop(void *userdata, const char *name, const char *oldValue, const char *newValue)
{
    g_WindowsEnableMessageLoop = SDL_GetStringBoolean(newValue, true);
}

static void SDLCALL UpdateWindowsEnableMenuMnemonics(void *userdata, const char *name, const char *oldValue, const char *newValue)
{
    g_WindowsEnableMenuMnemonics = SDL_GetStringBoolean(newValue, false);
}

static void SDLCALL UpdateWindowFrameUsableWhileCursorHidden(void *userdata, const char *name, const char *oldValue, const char *newValue)
{
    g_WindowFrameUsableWhileCursorHidden = SDL_GetStringBoolean(newValue, true);
}

#if !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES)
static bool WIN_SuspendScreenSaver(SDL_VideoDevice *_this)
{
    DWORD result;
    if (_this->suspend_screensaver) {
        result = SetThreadExecutionState(ES_CONTINUOUS | ES_DISPLAY_REQUIRED);
    } else {
        result = SetThreadExecutionState(ES_CONTINUOUS);
    }