RedM Natives

DISABLE_RAW_KEY_THIS_FRAME

Disables the specified rawKeyIndex, making it not trigger the regular IS_RAW_KEY_ natives.

Hash0x8BCF0014
Runtime nameDisableRawKeyThisFrame
NamespaceCFX
SideClient
NameOfficial
Docs

Signature

BOOL DISABLE_RAW_KEY_THIS_FRAME(int rawKeyIndex);

Parameters

NameTypeDescription
rawKeyIndexint

Index of raw key from keyboard.

Returns BOOL — Returns bool value of down state.

Description

Cfx.re native reference

Disables the specified rawKeyIndex, making it not trigger the regular IS_RAW_KEY_* natives.

Virtual key codes can be found here

Usage

Lua
local retval = DisableRawKeyThisFrame(rawKeyIndex)

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

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

Examples

LUA · Cfx.re native reference
local KEY_SPACE = 32
DisableRawKeyThisFrame(KEY_SPACE)
-- This will not get triggered this frame
if IsRawKeyDown(KEY_SPACE) then
	print("unreachable :(")
end
-- this will get triggered
if IsDisabledRawKeyDown(KEY_SPACE) then
    print("Spacebar is down")
end

Sources

Cfx.re native reference

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