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

Keys::unbind

Материал из RAGE MP Wiki Archive
Версия от 12:46, 15 января 2025; imported>Sander
(разн.) ← Предыдущая версия | Текущая версия (разн.) | Следующая версия → (разн.)

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.

Keycodes can be found here

Example

Client-Side

<syntaxhighlight lang="javascript"> function handler() { mp.gui.chat.push("F2 was pressed"); }

function toggle_keybind(state) { state ? mp.keys.bind(0x71, true, handler); /** binds F2 to the handler fn */ : mp.keys.unbind(0x71, true, handler); /** unbinds the handler from F2 key */ } </syntaxhighlight>

See also