{"name":"ctrlSetFocus","title":"ctrlSetFocus","type":"command","url":"https://community.bistudio.com/wiki/ctrlSetFocus","revid":373983,"updated":"2025-07-13T08:12:31Z","groups":["GUI Control"],"status":"ok","games":{"arma1":"1.00","arma2":"1.00","arma2oa":"1.50","tkoh":"1.00","arma3":"0.50"},"since":"arma1 1.00","arma3_since":"0.50","description":"Sets the input focus on given control.\n\n> [!IMPORTANT]\n> - ctrlSetFocus seems to only work on controls that accept any input from keyboard or mouse.\n> - if ctrlSetFocus is used on a CT_CONTROLS_GROUP that contains an interactable control, that control will automatically be active.\n> - if ctrlSetFocus is used on a CT_CONTROLS_GROUP in which there are no interactable controls, then ctrlSetFocus will do nothing.","syntaxes":[{"syntax":"ctrlSetFocus control","params":[{"name":"control","type":"Control","type_expr":"Control"}],"returns":{"type":"Nothing","type_expr":"Nothing"},"form":"unary","right":{"text":"control"}}],"examples":[{"code":["ctrlSetFocus _control;"]}],"see_also":["focusedCtrl"]}