input.key
The key module allows manipulate the client's keys.
Fields
| Name | Type | Description |
|---|---|---|
count | integer | The number of keys. |
Functions
input.key.capture | Starts a key capture and returns the key code of the key that was pressed. |
input.key.getCode | Get the key code of a name. |
input.key.getName | Get the name of a key. |
#input.key.capture
async function input.key.capture(): integer
Starts a key capture and returns the key code of the key that was pressed.
The captured key will not be pressed and committed to the game engine.
Returns
| Type | Name | Description |
|---|---|---|
integer | key_code | The key code of the key that was pressed. |
#input.key.getCode
function input.key.getCode(name: string): integer
Get the key code of a name.
Parameters
| Name | Type | Description |
|---|---|---|
name | string | The name of the key. |
Returns
| Type | Name | Description |
|---|---|---|
integer | key_code | The key code of the key. |
See also
key.getNameas a reverse lookup
#input.key.getName
function input.key.getName(key_code: integer): string
Get the name of a key.
Parameters
| Name | Type | Description |
|---|---|---|
key_code | integer | The key code of the key. |
Returns
| Type | Name | Description |
|---|---|---|
string | key_code | The name of the key. |