GetKeyBoundToFunction
Jump to navigation
Jump to search
<pageclass class="both" subcaption="Shared function"></pageclass> <lowercasetitle></lowercasetitle> getKeyBoundToFunction allows retrieval of the first key bound to a function.
Syntax
string getKeyBoundToFunction( player thePlayer, function theFunction )
Required ArgumentsRequired Arguments
- thePlayer: The player you are checking the function bound to a key
- theFunction: The function in which you would like to check the bound key
ReturnsReturns
Returns a string of the first key the function was bound to. </section>
<section name="Client" class="client" show="true">string getKeyBoundToFunction( function theFunction )
Required ArgumentsRequired Arguments
- theFunction: The function in which you would like to check the bound key
ReturnsReturns
Returns a string of the first key the function was bound to. </section>
Example
function chat ()
outputChatBox("Test")
end
bindKey("F2","down",chat)
function key()
local boundKey = getKeyBoundToFunction(chat)
outputChatBox(boundKey)
end
addCommandHandler("key",key)
This example written by Samurai </section>
See Also
- addCommandHandler
- bindKey
- executeCommandHandler
- getCommandHandlers
- getFunctionsBoundToKey
- getKeyBoundToFunction
- isControlEnabled
- removeCommandHandler
- toggleAllControls
- toggleControl
- unbindKey