- Documentation
- Shared functions
- isKeyBound
Function
isKeyBound
Checks whether a function is bound to a key (a specific one or any).
Syntax
Server
bool isKeyBound(player thePlayer, string key [, string keyState, function handler])Client
bool isKeyBound(string key [, string keyState, function handler])Arguments
thePlayerplayer- The player (server only).
keystring- The key.
keyStatestring, optional"down","up"or"both".handlerfunction, optional- A specific function.
Returns
true if something is bound.
Example
if not isKeyBound("F3") then
bindKey("F3", "down", function() outputChatBox("F3") end)
end
See also
bindKeyBinds a function or a command to a player's key. The function gets (on the server also the player) the key name, the state and the extra arguments frombindKey. Instead of a function you can pass a command name: the key runs it like/command. On the server the player's game watches the key and reports presses to the server.unbindKeyUnbinds a function or a command from a key. Without a function it removes everything from the key in that state, and without a state in both states.