> For the complete documentation index, see [llms.txt](https://manual.karamba3d.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://manual.karamba3d.com/3-in-depth-component-reference/3.8-utilities/3.9.20-key-listener.md).

# 3.9.20 Key Listener

In certain structural design workflows, it is desirable to switch seamlessly between different views or states of a model in the Rhino viewport without interacting directly with Grasshopper. For these situations, the **Key Listener** component provides an effective solution.

This component triggers updates to downstream components whenever the user presses **Shift** plus a function key. Its output "Counter" returns the number of key presses since the definition was opened. By default, the component listens for the **Shift + F1** combination. Through the **Fn** input, you can specify a number between 1 and 12 to make it respond to the corresponding function key.

<figure><img src="/files/9l6enUfwYj9IoNHhkv12" alt=""><figcaption><p>Fig. 3.9.20.1: Using a Key Listener component for switching free handedly between different views of a model.</p></figcaption></figure>

Figure 3.9.20.1 illustrates a section of a definition where a Key Listener, combined with a Stream Gate, controls which aspects of the model are displayed. In the first variant, the user cycles through available views by repeatedly pressing **Shift + F1**. In the second variant, **Shift + F1** advances to the next view, while **Shift + F2** returns to the previous one.

{% file src="/files/i0h5iTYss1fhwWSvsXm5" %}
