Adds or updates the keybind handler for a specified mod action, and associates a function with that keybind being pressed.
#include “\a3\ui_f\hpp\defineDIKCodes.inc”
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
0xFA: Custom user action 1 0xFB: Custom user action 2 0xFC: Custom user action 3 0xFD: Custom user action 4 0xFE: Custom user action 5 0xFF: Custom user action 6 0x100: Custom user action 7 0x101: Custom user action 8 0x102: Custom user action 9 0x103: Custom user action 10 0x104: Custom user action 11 0x105: Custom user action 12 0x106: Custom user action 13 0x107: Custom user action 14 0x108: Custom user action 15 0x109: Custom user action 16 0x10A: Custom user action 17 0x10B: Custom user action 18 0x10C: Custom user action 19 0x10D: Custom user action 20
_addon | Name of the registering mod + optional sub-category <STRING, ARRAY> |
_action | Id of the key action. STRING |
_title | Pretty name, or an array of pretty name and tooltip STRING |
_downCode | Code for down event, empty string for no code. <CODE> |
_upCode | Code for up event, empty string for no code. <CODE> |
_defaultKeybind | The keybinding data in the format [DIK, [shift, ctrl, alt]] ARRAY |
_holdKey | Will the key fire every frame while down <BOOLEAN> |
_holdDelay | How long after keydown will the key event fire, in seconds. <NUMBER> |
_overwrite | Overwrite any previously stored default keybind <BOOLEAN> |
Returns the current keybind for the action ARRAY
// Register a simple keypress to an action #include "\a3\ui_f\hpp\defineDIKCodes.inc" ["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;
Taosenai & Nou, commy2