RedM Natives

REMAP_RAW_KEYMAP

Remaps the keymap bound to keymapName to newRawKeyIndex Virtual key codes can be found here

Hash0x6E38C1B9
Runtime nameRemapRawKeymap
NamespaceCFX
SideClient
NameOfficial
Docs

Signature

void REMAP_RAW_KEYMAP(char* keymapName, int newRawKeyIndex);

Parameters

NameTypeDescription
keymapNamechar*

the name given to the keymap in REGISTER_RAW_KEYMAP

newRawKeyIndexint

Index of raw key from keyboard.

Returns void

Description

Cfx.re native reference

Remaps the keymap bound to keymapName to newRawKeyIndex

Virtual key codes can be found here

Usage

Lua
RemapRawKeymap(keymapName, newRawKeyIndex)

-- always works, by hash
Citizen.InvokeNative(0x6e38c1b9, keymapName, newRawKeyIndex)
JavaScript and C#
JavaScript
RemapRawKeymap(keymapName, newRawKeyIndex);

// by hash
Citizen.invokeNative('0x6e38c1b9', keymapName, newRawKeyIndex);
C#
Function.Call((Hash)0x6e38c1b9, keymapName, newRawKeyIndex);

Examples

LUA · Cfx.re native reference

function on_key_up()
	print("key no longer pressed")
end

function on_key_down()
	print("key is pressed")
end

local KEY_SPACE = 32
local canBeDisabled = false

local KEY_E = 69

RegisterRawKeymap("our_keymap", on_key_up, on_key_down, KEY_SPACE, canBeDisabled)

RemapRawKeymap("our_keymap", KEY_E)

See also

Sources

Cfx.re native reference

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