GetKeyString
Retrieves the name of the key corresponding to the provided key ID. This function returns the key name based on the current input device (keyboard or controller).
Parameters
keyID
: The ID of the key. For a list of key IDs, refer to the FiveM Documentation.
Returns
string
: The string will be the KEY name.
Usage
- Lua
- Javascript
local keyName = exports['FS-Lib']:GetKeyString(38)
print("Key Name: " .. keyName)
const keyName = exports['FS-Lib'].GetKeyString(38)
console.log(`Key Name: ${keyName}`)