RedM Natives

IS_RAW_KEY_RELEASED

Gets if the specified rawKeyIndex was just released on the keyboard.

Hash0xEAA50861
Runtime nameIsRawKeyReleased
NamespaceCFX
SideClient
NameOfficial
Docs

Signature

BOOL IS_RAW_KEY_RELEASED(int rawKeyIndex);

Parameters

NameTypeDescription
rawKeyIndexint

Index of raw key from keyboard.

Returns BOOL — Returns bool value of released state.

Description

Cfx.re native reference

Gets if the specified rawKeyIndex was just released on the keyboard.

This will not be triggered if the key is disabled with DISABLE_RAW_KEY_THIS_FRAME

Virtual key codes can be found here

Usage

Lua
local retval = IsRawKeyReleased(rawKeyIndex)

-- always works, by hash
local retval = Citizen.InvokeNative(0xeaa50861, rawKeyIndex, Citizen.ReturnResultAnyway())
JavaScript and C#
JavaScript
const retval = IsRawKeyReleased(rawKeyIndex);

// by hash
const retval = Citizen.invokeNative('0xeaa50861', rawKeyIndex, Citizen.returnResultAnyway());
C#
bool retval = Function.Call<bool>((Hash)0xeaa50861, rawKeyIndex);

Examples

LUA · Cfx.re native reference
if IsRawKeyReleased(32) then -- KEY_SPACE
    print("Spacebar released")
end

Sources

Cfx.re native reference

Something wrong or missing? Contribute a verified note — corrections ship through pull requests.