Keys::unbind: Difference between revisions
(Add mp.keys.unbind) |
|||
| Line 11: | Line 11: | ||
==Example== | ==Example== | ||
{{ClientSide}} | |||
<syntaxhighlight lang="javascript"> | <syntaxhighlight lang="javascript"> | ||
function checkKeyPressing() { | function checkKeyPressing() { | ||
| Line 25: | Line 24: | ||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
==See also== | ==See also== | ||
{{KeyBinding_function_c}} | {{KeyBinding_function_c}} | ||
Revision as of 23:29, 4 April 2018
This function unbinds the key.
Required Arguments
- keycode - Code of key (Hexadecimal).
- keyhold - Unbind the binds with keyhold-value.
Optional Arguments
- handler - Only unbind this handler.
Example
Client-Side
function checkKeyPressing() {
mp.gui.chat.push( "Pressing F2" );
}
function toggleTestMessageBind ( bool ) {
if ( bool )
mp.keys.bind( 0x71, true, checkKeyPressing ); //bind testMessage to F2
else
mp.keys.unbind( 0x71, true, checkKeyPressing ); //unbind it
}