# 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" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://manual.karamba3d.com/3-in-depth-component-reference/3.8-utilities/3.9.20-key-listener.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
