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.
- bool UnbindKey( int key, [ int state, closure func ] )
- bool BindKey( int key, [ int state, string func ] )
- 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
This example will remove the bind created in the example for BindKey.
- function onScriptUnload()
- UnbindKey( 'H', BINDTYPE_DOWN, "HalloThere" );
- return 1;
The event onScriptUnload was used in in this example. More info about it in the corresponding page.