CBA_fnc_addKeybind

Description

Adds or updates the keybind handler for a specified mod action, and associates a function with that keybind being pressed.

This file should be included for readable DIK codes

#include “\a3\editor_f\Data\Scripts\dikCodes.h”

Additional DIK codes usable with this function

0xF0: Left mouse button 0xF1: Right mouse button 0xF2: Middle mouse button 0xF3: Mouse #4 0xF4: Mouse #5 0xF5: Mouse #6 0xF6: Mouse #7 0xF7: Mouse #8 0xF8: Mouse wheel up 0xF9: Mouse wheel down

Parameters

_addonName of the registering mod STRING
_actionId of the key action.  STRING
_titlePretty name, or an array of pretty name and tooltip STRING
_downCodeCode for down event, empty string for no code.  <CODE>
_upCodeCode for up event, empty string for no code.  <CODE>

Optional

_defaultKeybindThe keybinding data in the format [DIK, [shift, ctrl, alt]] ARRAY
_holdKeyWill the key fire every frame while down <BOOLEAN>
_holdDelayHow long after keydown will the key event fire, in seconds.  <NUMBER>
_overwriteOverwrite any previously stored default keybind <BOOLEAN>

Returns

Returns the current keybind for the action ARRAY

Examples

// Register a simple keypress to an action
#include "\a3\editor_f\Data\Scripts\dikCodes.h"

["MyMod", "MyKey", ["My Pretty Key Name", "My Pretty Tool Tip"], {
    _this call mymod_fnc_keyDown
}, {
    _this call mymod_fnc_keyUp
}, [DIK_TAB, [false, false, false]]] call CBA_fnc_addKeybind;

["MyMod", "MyOtherKey", "My Other Pretty Key Name", {
    _this call mymod_fnc_keyDownOther
}, {
    _this call mymod_fnc_keyUpOther
}, [DIK_K, [false, false, false]]] call CBA_fnc_addKeybind;

Author

Taosenai & Nou, commy2

string used by format
Array to read from [Array]
Close