TooltipKeyBehavior

Package: Libraries.Interface.Behaviors.Controls · Inherits from: Libraries.Language.Object, Libraries.Interface.Behaviors.Behavior

The TooltipKeyBehavior class carries out the keys of tooltips, which DefaultInputSets:SetupTooltipInput gives it: Shift+F1 shows or hides the focused control's tooltip, Escape closes a tooltip, and Tab and Shift+Tab move among the buttons of a tooltip that has them. Each key gets its own behavior, set up with one of the constants.

Example Code

use Libraries.Interface.Behaviors.Controls.TooltipKeyBehavior
use Libraries.Game.InputSet
use Libraries.Game.InputTable
use Libraries.Interface.Events.KeyboardEvent

KeyboardEvent keys
InputSet showKey
showKey:SetKeyboardInput(keys:F1)
showKey:AddModifier(showKey:SHIFT)

TooltipKeyBehavior behavior
behavior:Setup(behavior:SHOW_OR_HIDE)

InputTable table
table:SetIdentifier("MyTooltipKeys")
table:Add(showKey, behavior)

Variables

  • integer PREVIOUS: Moves the focus to the previous button in the tooltip.
  • integer SHOW_OR_HIDE: Shows the focused control's tooltip, or hides the one showing.
  • integer CLOSE: Hides the tooltip, if one shows.
  • integer NEXT: Moves the focus to the next button in the tooltip.

Actions

GetMove()

This action returns what the key does: SHOW_OR_HIDE, CLOSE, NEXT or PREVIOUS.

Returns

integer: What the key does.

Example

use Libraries.Interface.Behaviors.Controls.TooltipKeyBehavior

TooltipKeyBehavior behavior
integer value = behavior:GetMove()

IsFinished()

This action returns true: the key's work is done at once.

Returns

boolean: true.

Run(Libraries.Interface.Events.BehaviorEvent event)

This action carries out the key on the game's TooltipManager. The input tables call it, so most users won't need to.

Parameters

Setup(integer value)

This action chooses what the key does: SHOW_OR_HIDE, CLOSE, NEXT or PREVIOUS.

Parameters

  • value integer: What the key does.

Example

use Libraries.Interface.Behaviors.Controls.TooltipKeyBehavior

TooltipKeyBehavior behavior
behavior:Setup(behavior:CLOSE)

Inherited Actions

6 actions from Libraries.Interface.Behaviors.Behavior
3 actions from Libraries.Language.Object