ctrlSetFocus: Difference between revisions

From Bohemia Interactive Community
mNo edit summary
(Moved not from Nelis75733126 into the description)
 
(57 intermediate revisions by 12 users not shown)
Line 1: Line 1:
[[Category:Scripting Commands|CTRLSETFOCUS]]
{{RV|type=command
[[Category:Scripting Commands ArmA|CTRLSETFOCUS]]


|game1= arma1
|version1= 1.00


<h2 style="color:#000066">''' ctrlSetFocus ''control'''''</h2>
|game2= arma2
|version2= 1.00


|game3= arma2oa
|version3= 1.50


'''Operand types:'''
|game4= tkoh
|version4= 1.00


'''control'''': [[Control]]
|game5= arma3
|version5= 0.50


'''Type of returned value:'''
|gr1= GUI Control


[[Nothing]]
|descr= Sets the input focus on given control.


'''Compatibility:'''
{{Feature|important|
* [[ctrlSetFocus]] seems to only work on controls that accept any input from keyboard or mouse.
* if [[ctrlSetFocus]] is used on a [[CT_CONTROLS_GROUP]] that contains an interactable control, that control will automatically be active.
* if [[ctrlSetFocus]] is used on a [[CT_CONTROLS_GROUP]] in which there are no interactable controls, then [[ctrlSetFocus]] will do nothing.}}


Version 2.92 required.
|s1= [[ctrlSetFocus]]  control


'''Description:'''
|p1= control: [[Control]]


Set the input focus on given control.
|r1= [[Nothing]]


|x1= <sqf>ctrlSetFocus _control;</sqf>


'''Example''':
|seealso= [[focusedCtrl]]
   
}}
'''ctrlSetFocus''' _control

Latest revision as of 09:12, 13 July 2025

Hover & click on the images for description

Description

Description:
Sets the input focus on given control.
Groups:
GUI Control

Syntax

Syntax:
ctrlSetFocus control
Parameters:
control: Control
Return Value:
Nothing

Examples

Example 1:
ctrlSetFocus _control;

Additional Information

See also:
focusedCtrl

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note