Skip to content

getKeyBoundToFunction

Client-side

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

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

  • string: value

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)