# InputEventKey

`import { InputEventKey } from "destack:input/binding";`

Input key event.

```ds title="InputEventKey"
export struct InputEventKey {
    kind: "key";
    header: InputEventHeader;
    action: InputEventAction;
    key: string;
    code: string;
    location: KeyLocation;
    hostCode: uint32;
    hostScanCode: uint32;
    hostValue: int64;
    hostModifiers: uint32;
    modifiers: ModifierState;
    isRepeat: boolean;
    isComposing: boolean;
}
```

[language/library/src/input/binding/event.ds:144:171](https://github.com/destack-sh/destack/blob/main/language/library/src/input/binding/event.ds#L144-L171)

## Members

### `kind: "key"`

Event discriminator.

### `header: InputEventHeader`

Shared event header.

### `action: InputEventAction`

Event action.

### `key: string`

Logical key value when available.

### `code: string`

Physical key code when available.

### `location: KeyLocation`

Key location.

### `hostCode: uint32`

Host-native key code.

### `hostScanCode: uint32`

Host-native scan code when available.

### `hostValue: int64`

Host-native key value.

### `hostModifiers: uint32`

Host-native modifier bitset.

### `modifiers: ModifierState`

Canonical modifier state.

### `isRepeat: boolean`

Whether the event is a repeat.

### `isComposing: boolean`

Whether the key event belongs to composition.
