FocusChain

A focus chain can be used to separate focus in different areas of the user interface. A device node (focus-based, like a keyboard or gamepad) node can be placed to control nodes inside.

For hover-based nodes like mouse, see HoverChain.

FocusChain only works with nodes compatible with the new I/O system introduced in Fluid 0.7.2.

Constructors

this
this()
Undocumented in source.
this
this(Node next)
Undocumented in source.

Members

Functions

afterDraw
void afterDraw(Rectangle outer, Rectangle inner)
Undocumented in source. Be warned that the author may not have intended to support it.
afterResize
void afterResize(Vector2 )
Undocumented in source. Be warned that the author may not have intended to support it.
beforeDraw
void beforeDraw(Rectangle , Rectangle )
Undocumented in source. Be warned that the author may not have intended to support it.
beforeResize
void beforeResize(Vector2 )
Undocumented in source. Be warned that the author may not have intended to support it.
currentFocus
inout(Focusable) currentFocus()
Undocumented in source. Be warned that the author may not have intended to support it.
currentFocus
Focusable currentFocus(Focusable newFocus)
Undocumented in source. Be warned that the author may not have intended to support it.
emitEvent
void emitEvent(InputEvent event)
Undocumented in source. Be warned that the author may not have intended to support it.
focusInDirection
void focusInDirection(FluidInputAction actionType)
Undocumented in source. Be warned that the author may not have intended to support it.
focusPreviousOrNext
void focusPreviousOrNext(FluidInputAction actionType)
Undocumented in source. Be warned that the author may not have intended to support it.
lastFocusBox
Optional!Rectangle lastFocusBox()
Undocumented in source. Be warned that the author may not have intended to support it.
orderedFocusAction
inout(OrderedFocusAction) orderedFocusAction()
Undocumented in source. Be warned that the author may not have intended to support it.
positionalFocusAction
inout(PositionalFocusAction) positionalFocusAction()
Undocumented in source. Be warned that the author may not have intended to support it.
readText
char[] readText(char[] buffer, int offset)
Undocumented in source. Be warned that the author may not have intended to support it.
runInputAction
bool runInputAction(InputActionID actionID, bool isActive)
bool runInputAction(bool isActive)
bool runInputAction(InputActionID actionID, bool isActive, int )

Handle an input action using the currently focused node.

runLocalInputActions
bool runLocalInputActions(InputActionID actionID, bool isActive)

Run an input action implemented by this node. These usually perform focus switching

typeText
void typeText(char[] text)

Type text to read during the next frame.

wasInputHandled
bool wasInputHandled()

If a node inside FocusChain triggers an input event (for example a keyboard node, like a keyboard automaton), another node inside may handle the event. This property will be set to true after that happens.

Mixins

__anonymous
mixin controlIO
Undocumented in source.

Variables

actionIO
ActionIO actionIO;
Undocumented in source.
findFocusBoxAction
FindFocusBoxAction findFocusBoxAction;

Focus box tracking action.

Inherited Members

From NodeChain

next
Node next(Node value)

Set the next node in chain.

next
inout(Node) next()
nextChain
inout(NodeChain) nextChain()
beforeResize
void beforeResize(Vector2 space)
Undocumented in source. Be warned that the author may not have intended to support it.
afterResize
void afterResize(Vector2 space)
Undocumented in source. Be warned that the author may not have intended to support it.
beforeDraw
void beforeDraw(Rectangle outer, Rectangle inner)
Undocumented in source. Be warned that the author may not have intended to support it.
afterDraw
void afterDraw(Rectangle outer, Rectangle inner)
Undocumented in source. Be warned that the author may not have intended to support it.
resizeImpl
void resizeImpl(Vector2 space)
Undocumented in source. Be warned that the author may not have intended to support it.
drawImpl
void drawImpl(Rectangle outer, Rectangle inner)
Undocumented in source. Be warned that the author may not have intended to support it.

From FocusIO

emitEvent
void emitEvent(InputEvent event)

Read an input event from an input device. Input devices will call this function every frame if an input event occurs.

typeText
void typeText(char[] text)

Write text received from the system. Input devices should call this function every frame to transmit text that the user wrote on the keyboard, which other nodes can then read through readText.

readText
char[] readText(char[] buffer, int offset)

Read text inserted by the user into a buffer.

From WithOrderedFocus

orderedFocusAction
inout(OrderedFocusAction) orderedFocusAction()
focusNext
FocusSearchAction focusNext(bool isReverse)
focusPrevious
FocusSearchAction focusPrevious()

focusNext focuses the next, and focusPrevious focuses the previous node, relative to the one that is currently focused.

focusFirst
FocusSearchAction focusFirst()
focusLast
FocusSearchAction focusLast()

Focus the first (focusFirst), or the last node (focusLast) that exists inside the focus space.

focusNext
bool focusNext(FluidInputAction )
Undocumented in source. Be warned that the author may not have intended to support it.
focusPrevious
bool focusPrevious(FluidInputAction )
Undocumented in source. Be warned that the author may not have intended to support it.

From WithPositionalFocus

lastFocusBox
Optional!Rectangle lastFocusBox()

To provide a reference for positional focus, the bounding box of the focused node.

positionalFocusAction
inout(PositionalFocusAction) positionalFocusAction()
focusAbove
FocusSearchAction focusAbove()
focusBelow
FocusSearchAction focusBelow()
focusToLeft
FocusSearchAction focusToLeft()
focusToRight
FocusSearchAction focusToRight()
focusDirection
FocusSearchAction focusDirection(Style.Side side)

Positional focus: Switch focus from the currently focused node to another based on screen position.

focusUp
bool focusUp()
Undocumented in source. Be warned that the author may not have intended to support it.
focusDown
bool focusDown()
Undocumented in source. Be warned that the author may not have intended to support it.
focusLeft
bool focusLeft()
Undocumented in source. Be warned that the author may not have intended to support it.
focusRight
bool focusRight()
Undocumented in source. Be warned that the author may not have intended to support it.

Meta