Skip to content

$keycache

4 natives. Read-only natives only look things up; the rest change something. Parameter types use the language's names (Types).

get

read-only
$keycache.get(user: User, keymap: Reference, aliases: list, remap: bool, ignore_input_mode: bool) -> list

Create a key cache with the states of a set of buttons.

ParameterTypeMeaning
userUserThe user handle.
keymapReferenceThe keymap used to determine aliased keys.
aliaseslistThe list of key aliases to store in the cache.
remapboolWhether to consider keymap remapping data of the given user.
ignore_input_modeboolWhether to ignore the input mode when checking if the keymap is active.

Returns list: A list containing the cache information.

is_down

read-only
$keycache.is_down(cache: list, alias_hash: int) -> bool

Test if aliased input is held down.

ParameterTypeMeaning
cachelistThe key cache.
alias_hashintThe hash of the name of the aliased input.

Returns bool: True if the aliased key is down.

is_pressed

read-only
$keycache.is_pressed(cache: list, alias_hash: int) -> bool

Test if aliased input changed from up to down this frame.

ParameterTypeMeaning
cachelistThe key cache.
alias_hashintThe hash of the name of the aliased input.

Returns bool: True if the aliased key was pressed.

is_released

read-only
$keycache.is_released(cache: list, alias_hash: int) -> bool

Test if aliased input changed from down to up this frame.

ParameterTypeMeaning
cachelistThe key cache.
alias_hashintThe hash of the name of the aliased input.

Returns bool: True if the aliased key was released.