[client] add new option input:captureOnFocus

This option allows the client to automatically enter capture mode if the
window is focused.

Closes #1088
This commit is contained in:
Geoffrey McRae
2023-09-11 21:01:19 +10:00
parent 219c73edbe
commit 193977895b
3 changed files with 15 additions and 0 deletions

View File

@@ -297,6 +297,13 @@ static struct Option options[] =
},
// input options
{
.module = "input",
.name = "captureOnFocus",
.description = "Enable capture mode when the window becomes focused",
.type = OPTION_TYPE_BOOL,
.value.x_bool = false
},
{
.module = "input",
.name = "grabKeyboard",
@@ -664,6 +671,7 @@ bool config_load(int argc, char * argv[])
case 270: g_params.winRotate = LG_ROTATE_270; break;
}
g_params.captureOnFocus = option_get_bool("input", "captureOnFocus" );
g_params.grabKeyboard = option_get_bool("input", "grabKeyboard" );
g_params.grabKeyboardOnFocus = option_get_bool("input", "grabKeyboardOnFocus" );
g_params.releaseKeysOnFocusLoss = option_get_bool("input", "releaseKeysOnFocusLoss");