> For the complete documentation index, see [llms.txt](https://docs.wisej.com/api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.wisej.com/api/wisej.web/general/control/wisej.web.keyeventargs.md).

# KeyEventArgs

Namespace: **Wisej.Web**

Assembly: **Wisej.Framework** (4.0.0.0)

Provides data for the [KeyDown](/api/wisej.web/general/control.md#keydown) or [KeyUp](/api/wisej.web/general/control.md#keyup) event.

{% tabs %}
{% tab title="C#" %}

```csharp
public class KeyEventArgs : EventArgs
```

{% endtab %}

{% tab title="VB.NET" %}

```visual-basic
Public Class KeyEventArgs
    Inherits EventArgs
```

{% endtab %}
{% endtabs %}

## Constructors

### ![](/files/hsR4ok3152WyAf8J2C1u) KeyEventArgs(keyData)

Initializes a new instance of the [KeyEventArgs](/api/wisej.web/general/control/wisej.web.keyeventargs.md) class.

| Name        | Type                                                  | Description                                                                                                                                                                                                                                                                                                                                                                 |
| ----------- | ----------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **keyData** | [Keys](/api/wisej.web/enumerations/wisej.web.keys.md) | A [Keys](/api/wisej.web/enumerations/wisej.web.keys.md) representing the key that was pressed, combined with any modifier flags that indicate which CTRL, SHIFT, and ALT keys were pressed at the same time. Possible values are obtained be applying the bitwise OR (\|) operator to constants from the [Keys](/api/wisej.web/enumerations/wisej.web.keys.md) enumeration. |

## Properties

### ![](/files/hsR4ok3152WyAf8J2C1u) Alt

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Returns whether the ALT key was pressed.

### ![](/files/hsR4ok3152WyAf8J2C1u) Control

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Returns whether the CTRL key was pressed.

### ![](/files/hsR4ok3152WyAf8J2C1u) Handled

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Returns or sets whether the event was handled.

### ![](/files/hsR4ok3152WyAf8J2C1u) KeyCode

[Keys](/api/wisej.web/enumerations/wisej.web.keys.md): Returns the keyboard code..

### ![](/files/hsR4ok3152WyAf8J2C1u) KeyData

[Keys](/api/wisej.web/enumerations/wisej.web.keys.md): Returns the key data.

### ![](/files/hsR4ok3152WyAf8J2C1u) KeyValue

[Int32](https://docs.microsoft.com/dotnet/api/system.int32): Returns the keyboard value.

### ![](/files/hsR4ok3152WyAf8J2C1u) Modifiers

[Keys](/api/wisej.web/enumerations/wisej.web.keys.md): Returns the modifier flags indicating which combination of CTRL, SHIFT, and ALT keys was pressed.

### ![](/files/hsR4ok3152WyAf8J2C1u) Shift

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Returns a value indicating whether the SHIFT key was pressed.

## Methods

### ![](/files/hsR4ok3152WyAf8J2C1u) IsAltPressed()

Returns whether the Alt key is pressed.

**Returns:** [Boolean](https://docs.microsoft.com/dotnet/api/system.boolean).

### ![](/files/hsR4ok3152WyAf8J2C1u) IsCtrlPressed()

Returns whether the Control key is pressed.

**Returns:** [Boolean](https://docs.microsoft.com/dotnet/api/system.boolean).

### ![](/files/hsR4ok3152WyAf8J2C1u) IsShiftPressed()

Returns whether the Shift key is pressed.

**Returns:** [Boolean](https://docs.microsoft.com/dotnet/api/system.boolean).

## Used By

| Name                                                                           | Description                                                                                                                                                                                                  |
| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| [KeyEventHandler](/api/wisej.web/general/control/wisej.web.keyeventhandler.md) | Represents the method that will handle the [KeyUp](/api/wisej.web/general/control.md#keyup) or [KeyDown](/api/wisej.web/general/control.md#keydown) event of a [Control](/api/wisej.web/general/control.md). |


---

# 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:

```
GET https://docs.wisej.com/api/wisej.web/general/control/wisej.web.keyeventargs.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.
