mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2024-12-20 22:16:49 +01:00
Added Windows support for SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH
This commit is contained in:
parent
a13da2faa7
commit
d285af2a96
@ -198,6 +198,12 @@ WindowsScanCodeToSDLScanCode(LPARAM lParam, WPARAM wParam)
|
|||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static SDL_bool
|
||||||
|
WIN_ShouldIgnoreFocusClick()
|
||||||
|
{
|
||||||
|
const char *hint = "1";//SDL_GetHint(SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH);
|
||||||
|
return (!hint || (*hint == '0')) ? SDL_TRUE : SDL_FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
WIN_CheckWParamMouseButton(SDL_bool bwParamMousePressed, SDL_bool bSDLMousePressed, SDL_WindowData *data, Uint8 button, SDL_MouseID mouseID)
|
WIN_CheckWParamMouseButton(SDL_bool bwParamMousePressed, SDL_bool bSDLMousePressed, SDL_WindowData *data, Uint8 button, SDL_MouseID mouseID)
|
||||||
@ -210,8 +216,10 @@ WIN_CheckWParamMouseButton(SDL_bool bwParamMousePressed, SDL_bool bSDLMousePress
|
|||||||
WIN_UpdateClipCursor(data->window);
|
WIN_UpdateClipCursor(data->window);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (WIN_ShouldIgnoreFocusClick()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (bwParamMousePressed && !bSDLMousePressed) {
|
if (bwParamMousePressed && !bSDLMousePressed) {
|
||||||
SDL_SendMouseButton(data->window, mouseID, SDL_PRESSED, button);
|
SDL_SendMouseButton(data->window, mouseID, SDL_PRESSED, button);
|
||||||
|
Loading…
Reference in New Issue
Block a user