# CFX::IS_RAW_KEY_DOWN

- **Hash:** `0xD95A7387`
- **Namespace:** CFX
- **Runtime name (Lua/JS):** `IsRawKeyDown`
- **Side:** client (Cfx runtime native)
- **Name status:** official
- **Documentation:** described with examples
- **URL:** https://natives.borderlinerp.com/natives/CFX/IS_RAW_KEY_DOWN

## Signature

```c
BOOL IS_RAW_KEY_DOWN(int rawKeyIndex);
```

## Parameters

- `rawKeyIndex` (`int`) — Index of raw key from keyboard.

## Returns

`BOOL` — Returns bool value of down state.

## Description

*Source: Cfx.re native reference*

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](#\_0x8BCF0014)

Virtual key codes can be found [here](https://learn.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes)

## Usage

### Lua

```lua
local retval = IsRawKeyDown(rawKeyIndex)

-- always available, by hash
local retval = Citizen.InvokeNative(0xd95a7387, rawKeyIndex, Citizen.ReturnResultAnyway())
```

### JavaScript

```js
const retval = IsRawKeyDown(rawKeyIndex);

// by hash
const retval = Citizen.invokeNative('0xd95a7387', rawKeyIndex, Citizen.returnResultAnyway());
```

### C#

```csharp
bool retval = Function.Call<bool>((Hash)0xd95a7387, rawKeyIndex);
```

## Examples

*Source: Cfx.re native reference*

```lua
if IsRawKeyDown(32) then -- KEY_SPACE
    print("Spacebar is down")
end
```

*Sources: Cfx.re native reference.*
