getKeyBoundToFunction | Multi Theft Auto: Wiki Skip to content

getKeyBoundToFunction

Client-side
Server-side
Shared

Manual Review Required

Please finish this page using the corresponding Old Wiki article. Go to Contribution guidelines for more information.


getKeyBoundToFunction allows retrieval of the first key bound to a function.

Syntax

string getKeyBoundToFunction ( function theFunction )
Required Arguments
  • theFunction: The function in which you would like to check the bound key

Returns

  • string: value

Returns a string of the first key the function was bound to.

Code Examples

client

/key command gives bounded key to our chat function

function chat ()
outputChatBox("Test")
end
bindKey("F2","down",chat)
function key()
local boundKey = getKeyBoundToFunction(chat)
outputChatBox(boundKey)
end
addCommandHandler("key",key)