Key::bind: Difference between revisions
Kostya nad (talk | contribs) m (Kostya nad moved page Keys::bind to Key::bind) |
No edit summary |
||
| Line 19: | Line 19: | ||
==See also== | ==See also== | ||
{{ | {{KeyBinding_function_c}} | ||
Revision as of 21:26, 4 November 2017
This function binds the key .
Parameters
- keycode - code of key (Int).
- bool0 - toggle of what? (Bool)
- handler - function-handler.
Example
This example calling server event.
Client-Side
// 0x12 is a Alt keycode
mp.keys.bind(0x12,true,function(){
mp.events.callRemote('keypress:Alt'); // Calling server event "keypress:Alt"
});