# KeyPressedEvent

Gets called when a key is pressed.

### Extends

* [`CancellableEvent`](https://scripting.breeze.rip/api/breeze/event/cancellableevent)

### Methods

#### cancel()

> **cancel**(): `void`

Cancels the event.

**Returns**

`void`

**Inherited from**

[`CancellableEvent`](https://scripting.breeze.rip/api/breeze/event/cancellableevent).[`cancel`](https://scripting.breeze.rip/breeze/event/cancellableevent#cancel)

***

#### getKeyCode()

> **getKeyCode**(): `number`

Gets the key code of the key that was pressed.

**Returns**

`number`

the key code of the key that was pressed.

***

#### isCancelled()

> **isCancelled**(): `boolean`

**Returns**

`boolean`

If the event is cancelled or not.

**Inherited from**

[`CancellableEvent`](https://scripting.breeze.rip/api/breeze/event/cancellableevent).[`isCancelled`](https://scripting.breeze.rip/breeze/event/cancellableevent#iscancelled)
