Skip to content

Commit

Permalink
Merge pull request #1379 from mattysmith22/bug-addKeybind-custom-control
Browse files Browse the repository at this point in the history
Fixed CBA_fnc_addKeybind and custom controls
  • Loading branch information
commy2 authored Dec 16, 2020
2 parents 6904efc + ac82361 commit 4ef809c
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion addons/keybinding/fnc_addKeybind.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,27 @@ Description:
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
Parameters:
_addon - Name of the registering mod + optional sub-category <STRING, ARRAY>
_action - Id of the key action. <STRING>
Expand Down Expand Up @@ -103,7 +124,7 @@ if (!(_upCode isEqualType {})) then {
_defaultKeybind params [["_defaultKey", 0, [0]], ["_defaultModifiers", [], [[]]]];
_defaultModifiers params [["_defaultShift", false, [false]], ["_defaultControl", false, [false]], ["_defaultAlt", false, [false]]];

if (_defaultKey >= 255) then {
if (_defaultKey > 0x10D) then {
WARNING_2("Keybind %1's default keybind is invalid [DIK: %2]",_action,_defaultKey);
_defaultKey = 0;
};
Expand Down

0 comments on commit 4ef809c

Please sign in to comment.