1.5 KiB
TAB and Control Focus
If a focusable control is put on a window, by setting theTabPriorityproperty to a value that is not**-1**, then it could get focused by pressingTAB.
PressingTABswitches the focus between different controls in a window, in the order of theirTabPriorityfrom less to greater, when bothIsTabEnabledandIsTabAvailablereturntrue. If the value is less than**-1**, then they will be treated as0xFFFFFFFFFFFFFFFF. The order between controls with the sameTabPriorityis undefined.
Behavior after being Focused
A focusable control will just get focused ifTABdecides to give the focus to this control.
Create your own Behavior
If a new control class is created, there are multiple ways to customize the behavior about how a control should react toTAB:
Using IGuiTabAction
IGuiTabActionis a protected base class of all controls. If a new control is created, methods could be overriden.
IsTabEnabledreturnstrueif the control is visible and enabled.IsTabAvailablereturnstrueif the control is focusable.
The default value fromGetAcceptTabInputisfalse. But a few controls like text controls or document controls set this value totrue. WhenGetAcceptTabInputistrue, it means this control defines the behavior for this key, like entering aTABcharacter, so that it doesn't want the focus to be switched to another control. CallingSetAcceptTabInputcould change this value.