REMAP_RAW_KEYMAP
Remaps the keymap bound to keymapName to newRawKeyIndex Virtual key codes can be found here
Signature
void REMAP_RAW_KEYMAP(char* keymapName, int newRawKeyIndex);Parameters
| Name | Type | Description |
|---|---|---|
keymapName | char* | the name given to the keymap in REGISTER_RAW_KEYMAP |
newRawKeyIndex | int | Index of raw key from keyboard. |
Returns void
Description
Remaps the keymap bound to keymapName to newRawKeyIndex
Virtual key codes can be found here
Usage
RemapRawKeymap(keymapName, newRawKeyIndex)
-- always works, by hash
Citizen.InvokeNative(0x6e38c1b9, keymapName, newRawKeyIndex)JavaScript and C#
RemapRawKeymap(keymapName, newRawKeyIndex);
// by hash
Citizen.invokeNative('0x6e38c1b9', keymapName, newRawKeyIndex);Function.Call((Hash)0x6e38c1b9, keymapName, newRawKeyIndex);Examples
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
REGISTER_RAW_KEYMAPRegisters a keymap that will be triggered whenever rawKeyIndex is pressed or released.
Sources
Something wrong or missing? Contribute a verified note — corrections ship through pull requests.