> For the complete documentation index, see [llms.txt](https://cmonkeys.gitbook.io/cinput-reference-manual/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cmonkeys.gitbook.io/cinput-reference-manual/script-reference/methods/getkey.md).

# GetKey

*bool* **GetKey**(*string* **description**)\
*bool* **GetKey**(*int* **descriptionHash**)

## Parameters

**description**: The name of the key, as defined in [`SetKey()`](/cinput-reference-manual/script-reference/methods/setkey.md).\
**descriptionHash**: The hashcode of the name of the key, as defined in [`SetKey()`](/cinput-reference-manual/script-reference/methods/setkey.md).

## Returns

**bool**: Returns `true` if the key is being held down.

## Description

Use this to determine if a key is being held down. `GetKey()` returns `true` **repeatedly** while the user holds down the key, and returns `false` if the key is not being pressed.

The use of [`GetKeyDown()`](/cinput-reference-manual/script-reference/methods/getkeydown.md) or [`GetKeyUp()`](/cinput-reference-manual/script-reference/methods/getkeyup.md) is recommended if you want to trigger an event only once per keypress, e.g., for jumping.

## Example
