Documentation
¶
Overview ¶
Package focus demonstrates a screen with multiple components sharing one keyboard, using pkg/focus to decide which of them has it.
A focus.Group holds the components in tab order and owns three things a hand-rolled index cannot do as well:
- tab / shift-tab cycling, including the blur-everything-focus-one dance
- granting focus to a component that was clicked, since the click arrives at the component rather than at the screen that knows the ordering
- answering IsCapturingKeys from whichever component currently has focus
The screen still routes messages itself, because focus is about the keyboard and not about content: keys go to the focused component only — otherwise typing in the query would also drive the list's cursor — while mouse events go to every component, so each can test the click against its own rect and claim it if it landed inside.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.