dreamworkAPI
Ctrl K
GitHub
libraryDocs / input / key

input.key

libraryclientmenusource

The key module allows manipulate the client's keys.

Fields

NameTypeDescription
countintegerThe number of keys.

Functions

input.key.captureStarts a key capture and returns the key code of the key that was pressed.
input.key.getCodeGet the key code of a name.
input.key.getNameGet the name of a key.

#input.key.capture

clientmenuasyncnodiscardsource
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
TypeNameDescription
integerkey_codeThe key code of the key that was pressed.

#input.key.getCode

clientmenunodiscardsource
function input.key.getCode(name: string): integer

Get the key code of a name.

Parameters
NameTypeDescription
namestringThe name of the key.
Returns
TypeNameDescription
integerkey_codeThe key code of the key.
See also
  • key.getName as a reverse lookup

#input.key.getName

clientmenunodiscardsource
function input.key.getName(key_code: integer): string

Get the name of a key.

Parameters
NameTypeDescription
key_codeintegerThe key code of the key.
Returns
TypeNameDescription
stringkey_codeThe name of the key.
Generated from the dreamwork meta branch.