IS_RAW_KEY_DOWN
Gets if the specified rawKeyIndex is pressed down on the keyboard.
Signature
BOOL IS_RAW_KEY_DOWN(int rawKeyIndex);Parameters
| Name | Type | Description |
|---|---|---|
rawKeyIndex | int | Index of raw key from keyboard. |
Returns BOOL — Returns bool value of down state.
Description
Gets if the specified rawKeyIndex is pressed down 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
local retval = IsRawKeyDown(rawKeyIndex)
-- always works, by hash
local retval = Citizen.InvokeNative(0xd95a7387, rawKeyIndex, Citizen.ReturnResultAnyway())JavaScript and C#
const retval = IsRawKeyDown(rawKeyIndex);
// by hash
const retval = Citizen.invokeNative('0xd95a7387', rawKeyIndex, Citizen.returnResultAnyway());bool retval = Function.Call<bool>((Hash)0xd95a7387, rawKeyIndex);Examples
if IsRawKeyDown(32) then -- KEY_SPACE
print("Spacebar is down")
endSources
Something wrong or missing? Contribute a verified note — corrections ship through pull requests.