DISABLE_RAW_KEY_THIS_FRAME
Disables the specified rawKeyIndex, making it not trigger the regular IS_RAW_KEY_ natives.
Signature
BOOL DISABLE_RAW_KEY_THIS_FRAME(int rawKeyIndex);Parameters
| Name | Type | Description |
|---|---|---|
rawKeyIndex | int | Index of raw key from keyboard. |
Returns BOOL — Returns bool value of down state.
Description
Disables the specified rawKeyIndex, making it not trigger the regular IS_RAW_KEY_* natives.
Virtual key codes can be found here
Usage
local retval = DisableRawKeyThisFrame(rawKeyIndex)
-- always works, by hash
local retval = Citizen.InvokeNative(0x8bcf0014, rawKeyIndex, Citizen.ReturnResultAnyway())JavaScript and C#
const retval = DisableRawKeyThisFrame(rawKeyIndex);
// by hash
const retval = Citizen.invokeNative('0x8bcf0014', rawKeyIndex, Citizen.returnResultAnyway());bool retval = Function.Call<bool>((Hash)0x8bcf0014, rawKeyIndex);Examples
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")
endSources
Something wrong or missing? Contribute a verified note — corrections ship through pull requests.