Open main menu
Home
Random
Log in
Settings
About AddOn Studio
Disclaimers
AddOn Studio
Search
Editing
Engine:CCMD bind
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{dev/uiccmd}} Creates a new key binding, replacing existing key binding if any. <kua>bind Z "echo fred"</kua> == Arguments == * name - name of binding, which corresponds to a particular key, button, or other device. * value (optional) - script string or command to run. If not supplied, then prints the script or command value, if the binding exists. == Associations == * Key bindings are global, and not a part of any context. == Details == A 'bind' acts like a custom command for a key. It runs the assigned text as a script, which can contain a single-word command, statement, or script. By default, binds do not work while input focus is in console or in text mode. Binds have a special relationship with commands and aliases, where specially named commands will get run during special key or device states. For example, if an alias is named '+bob' and is bound to a key, it will only get called when that key is pressed down, and if named '-bob' will get called when the key goes up. == Examples == === Default values === * Check bind 'Z' for script value. No bind exists for key 'Z'. <kua> > bind Z Unknown: Z </kua> * Create a bind for the 'Z' key. <kua> > bind Z "echo fred" </kua> * Close console and press 'Z' key. Prints 'fred'. <kua> fred </kua> * Same as the first example, but now bind 'Z' exists and shows the value. <kua> > alias bob 'bob' is 'echo fred' </kua> === Key states === * '+zoom' called without a value. No command, variable or alias named '+zoom' exist. <kua> > +zoom Unknown: +zoom </kua> * Create an alias for '+zoom' and '-zoom'. <kua> > alias +zoom "set fov 45; print 'zoom is 45'" > alias -zoom "set fov 90; print 'zoom is 90'" </kua> * Create a binding for the 'Z' key. <kua> > bind Z +zoom </kua> * Close console and press and release the 'Z' key. Zooms in and out and prints zoom messages. <kua> zoom is 45 zoom is 90 </kua> == Notes == *
Summary:
Please note that all contributions to AddOn Studio are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
AddOn Studio Wiki:Copyrights
for details).
Submissions must be written by you, or copied from a public domain or similar free resource (see
AddOn Studio Wiki:Copyrights
for details).
Cancel
Editing help
(opens in new window)
Templates used on this page:
Template:Crumb
(
edit
)
Template:Crumbtext
(
edit
)
Template:Dev/uiccmd
(
edit
)
Template:Editlink
(
edit
)
Template:Engine/devnav
(
edit
)
Template:Tocright
(
edit
)