Add love.window.focus (resolves #1911).

Calling the function brings the window into the foreground and makes it the focused window for keyboard input.
This commit is contained in:
Sasha Szpakowski
2023-04-01 18:02:16 -03:00
parent 0b48dacb4e
commit 2c3ea60c79
4 changed files with 18 additions and 0 deletions
+7
View File
@@ -548,6 +548,12 @@ int w_restore(lua_State *)
return 0;
}
int w_focus(lua_State *)
{
instance()->focus();
return 0;
}
int w_isMaximized(lua_State *L)
{
luax_pushboolean(L, instance()->isMaximized());
@@ -668,6 +674,7 @@ static const luaL_Reg functions[] =
{ "minimize", w_minimize },
{ "maximize", w_maximize },
{ "restore", w_restore },
{ "focus", w_focus },
{ "isMaximized", w_isMaximized },
{ "isMinimized", w_isMinimized },
{ "showMessageBox", w_showMessageBox },