> For the complete documentation index, see [llms.txt](https://wfsys.gitbook.io/workflow-forms-syntax/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wfsys.gitbook.io/workflow-forms-syntax/workflow_forms/conditions/event_condition/key_press_condition.md).

# KeyPressCondition

## Шаблон KeyPressCondition <a href="#template_key_press_condition" id="template_key_press_condition"></a>

```xml
<Condition Name="" Type="KeyPressCondition" Assembly="Conditions">
  <!--Тэги, общие для всех условий-->
  <AlwaysChange Value="" />
  <!--Тэги, специфичные для KeyPressCondition-->
  <Object Name="" />
  <ExceptObjects>
    <Object Name="" />
  </ExceptObjects>
  <Key Code="" />
  <Handle></Handle>
</Condition>
```

## Описание KeyPressCondition <a href="#description_key_press_condition" id="description_key_press_condition"></a>

```xml
<Condition Name="KeyPressConditionName" Type="KeyPressCondition" Assembly="Conditions">
  <!--Тэги, общие для всех условий-->
  <!--Тэги, специфичные для KeyPressCondition-->
</Condition>
```

## Тэги, специфичные для KeyPressCondition <a href="#tags_key_press_condition" id="tags_key_press_condition"></a>

### Object <a href="#object" id="object"></a>

[Объект](/workflow-forms-syntax/workflow_forms/objects.md), на котором срабатывает событие нажатия клавиши символа.

Необязательный тэг. Значение тэга `<Object>`: не ожидается.

Если тэг `<Object>` отсутствует, то событие срабатывает для формы.

```xml
<Object Name="ObjectName" />
```

#### Атрибуты тэга `<Object>` <a href="#attributes_tag_object" id="attributes_tag_object"></a>

<table data-header-hidden><thead><tr><th width="150" align="center"></th><th width="502.3333333333333"></th></tr></thead><tbody><tr><td align="center">Name</td><td><p>Название объекта.</p><p></p><p>Обязательный атрибут. Ожидается название одного из объектов, описанных в форме.</p></td></tr></tbody></table>

### ExceptObjects <a href="#except_objects" id="except_objects"></a>

Список [объектов](/workflow-forms-syntax/workflow_forms/objects.md) формы, нажатие клавиш в которых не вызывает срабатывание события.

Необязательный тэг. Значение тэга `<ExceptObjects>`: список тэгов [`<Object>`](#except_objects_object).

При наличии тэга [`<Object>`](#object) тэг `<ExceptObjects>` игнорируется.

```xml
<ExceptObjects>
  <Object Name="ObjectName1" />
  <Object Name="ObjectName2" />
</ExceptObjects>
```

#### Тэг `<Object>` <a href="#except_objects_object" id="except_objects_object"></a>

[Объект](/workflow-forms-syntax/workflow_forms/objects.md) формы, нажатие клавиши в котором не будет вызывать событие.

Необязательный тэг. Значение тэга `<Object>`: не ожидается.

#### Атрибуты тэга `<Object>` <a href="#attributes_tag_except_objects_object" id="attributes_tag_except_objects_object"></a>

<table data-header-hidden><thead><tr><th width="150" align="center"></th><th width="502.3333333333333"></th></tr></thead><tbody><tr><td align="center">Name</td><td><p>Название объекта.</p><p></p><p>Обязательный атрибут. Ожидается название одного из объектов, описанных в форме.</p></td></tr></tbody></table>

### Key <a href="#key" id="key"></a>

Описание нажатой клавиши.

Обязательный тэг. Значение тэга `<Key>`: не ожидается.

```xml
<Key Code="13" />
```

#### Атрибуты тэга `<Key>` <a href="#attributes_tag_key" id="attributes_tag_key"></a>

<table data-header-hidden><thead><tr><th width="150" align="center"></th><th width="502.3333333333333"></th></tr></thead><tbody><tr><td align="center">Code</td><td><p>Код нажатой клавиши.</p><p></p><p>Обязательный атрибут. Ожидается целочисленное значение от 0 до 255.</p></td></tr></tbody></table>

### Handle <a href="#handle" id="handle"></a>

Признак, определяющий, будет ли передаваться дальше на объекты управление после обработки данного условия нажатие клавиши.

Необязательный тэг. Ожидается логическое значение.

Если тэг `<Handle>` отсутствует, то используется значение True.

```xml
<Handle>True</Handle>
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://wfsys.gitbook.io/workflow-forms-syntax/workflow_forms/conditions/event_condition/key_press_condition.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
