ControlsClient

getControlValue

GET_CONTROL_VALUE0xD95E79E8686D2C27

The GTA V native GET_CONTROL_VALUE of the PAD namespace, as LS:MP client scripts call it: the global function getControlValue, in JavaScript and in Lua.

SignatureJavaScript
getControlValue(control: number, action: number): number
SignatureLua
getControlValue(control: integer, action: integer): integer

Usage

JavaScript
const result = getControlValue(control, action);
Lua
local result = getControlValue(control, action)

Parameters

ParameterTypeJavaScriptLuaDescription
controlintnumberintegersee isControlEnabled
actionintnumberinteger

Returns

int JavaScript number, Lua integer

On LS:MP

ℹ
Input while LS:MP has the focus

While the LS:MP menu, the console or a focused browser holds the keyboard and mouse, this native does not reach the game: it returns 127, the value of a control at rest.

Reference

Namespace
Controls PAD
In the game
int GET_CONTROL_VALUE(int control, int action)
Hash
0xD95E79E8686D2C27

Open in the interactive natives reference