UnbindKey

From Liberty Unleashed Wiki
Jump to: navigation, search
Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events


This function unbinds a key from a previously bound handler function. If only the key (or key and keystate) are defined, all bound functions are removed from that key.

Syntax

  1. bool UnbindKey( int key, [ int state, closure func ] )
  1. bool BindKey( int key, [ int state, string func ] )

Arguments

  • key - This is the key to remove the keybind for. For keys 'A'-'Z' and '0'-'9' this value will be the ascii code of the character. For special keys, check a list here
  • state - The bind type, either BINDTYPE_DOWN (triggered when the key is pressed down) or BINDTYPE_UP (triggered when the key is released). This argument is optional
  • func - Either a pointer to the handler function or the name of the function as a string. This argument is optional

Example

This example will remove the bind created in the example for BindKey.

  1.  
  2. function onScriptUnload()
  3. {
  4. UnbindKey( 'H', BINDTYPE_DOWN, "HalloThere" );
  5.  
  6. return 1;
  7. }
  8.  

Notes

The event onScriptUnload was used in in this example. More info about it in the corresponding page.

Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox