diff --git a/Keyboard-focus.md b/Keyboard-focus.md index 2407e94..5ee7f53 100644 --- a/Keyboard-focus.md +++ b/Keyboard-focus.md @@ -40,4 +40,20 @@ The **container.KeyFocusPrevious** option is used to configure a key that will m Even if a key is configured to move the focus, it still gets delivered as a keyboard event to widgets that subscribe to keyboard events. See the [[Widget API|Widget-API]] for details about subscribing widgets to keyboard events. -A widget that subscribed with **KeyScopeGlobal** always get's the key press event. A widget that subscribed with **KeyScopeFocused** only gets the key press event if it is focused after the focus change. \ No newline at end of file +A widget that subscribed with **KeyScopeGlobal** always get's the key press event. A widget that subscribed with **KeyScopeFocused** only gets the key press event if it is focused after the focus change. + +### Using keyboard events within focus groups + +In addition to the **container.KeyFocusNext** and **container.KeyFocusPrevious** options that allow moving keyboard focus through all leaf containers, the user can also assign containers into separate focus groups. + +#### [container.KeyFocusGroup](https://godoc.org/github.com/mum4k/termdash/container#KeyFocusGroup): + +The **container.KeyFocusGroup** assigns a container into a focus group identified by a number. + +#### [container.KeyFocusGroupNext](https://godoc.org/github.com/mum4k/termdash/container#KeyFocusGroupNext): + +The **container.KeyFocusGroupNext** is like the **container.KeyFocusNext** option, but the keys configured using this option only move the keyboard focus within a single focus group. The key only takes effect if the currently focused container is a part of the same focus group. + +#### [container.KeyFocusGroupPrevious](https://godoc.org/github.com/mum4k/termdash/container#KeyFocusGroupPrevious): + +The **container.KeyFocusGroupPrevious** is like the **container.KeyFocusPrevious** option, but the keys configured using this option only move the keyboard focus within a single focus group. The key only takes effect if the currently focused container is a part of the same focus group. \ No newline at end of file