

For more information on optional arguments, see optional arguments. NOTE: When using optional arguments, you might need to supply all arguments before the one you wish to use.

See key names for a list of possible keys. key: The key or control you wish to bind to the command.Use in conjunction with addCommandHandler to add handler functions to the keybind.īool bindKey ( string key, string keyState, string commandName, ) Required Arguments This will also allow users to customize the control in their Settings menu. This alternative syntax allows you to bind a key with a command. arguments The optional arguments you specified when calling bindKey (see below).īool bindKey ( string key, string keyState, function handlerFunction, ) Required Argumentsįunction functionName ( string key, string keyState, ) The values passed to this function are:.

keyState: The state of the key that was pressed, down if it was pressed, up if it was released.keyPresser: The player who pressed the key.This function should have the form:įunction functionName ( player keyPresser, string key, string keyState, ) The values passed to this function are: handlerFunction: The function that will be triggered when the player's key is pressed."both": If the bound key should trigger the function when the key is pressed or released."down": If the bound key should trigger the function when the key is pressed."up": If the bound key should trigger the function when the key is released.keyState: A string that has one of the following values:.

See key names for a list of possible keys and control names for a list of possible controls. thePlayer: The player you wish to bind the key of.Bool bindKey ( player thePlayer, string key, string keyState, function handlerFunction, ) Required Arguments
