Перейти к содержанию

Key::bind

Материал из RAGE MP Wiki Archive
(перенаправлено с «Keys::bind»)

Client-Side
Function

Ошибка создания миниатюры: Не удаётся сохранить эскиз по месту назначения JavaScript



Description

This function binds the key.

Parameters

  • keycode - hexadecimal code of key.
  • keydown/keyup - true trigges on keydown, false triggers on keyup (bool)
  • handler - function-handler.

Example

This example calling server event.

<syntaxhighlight lang="javascript"> /** binds F2 to this inline arrow function */ mp.keys.bind(0x71, true, () => { mp.gui.chat.push("F2 was pressed") }); </syntaxhighlight>

See also