Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expliclty add modifyer settings for Shift/Ctrl/Alt #583

Merged
merged 2 commits into from
Feb 10, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions addons/keybinding/fnc_addKeybind.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,13 @@ if (count _defaultKeybind == 4) then {
_defaultKeybind = [_defaultKeybind select 0, _modifiers];
};

// Make sure modifer is set to true, if base key is a modifier
// This can happen with script added keybinds AND from the rebinding code (fnc_onLBDblClick)
_defaultKeybind params ["_keyNumber", "_keyParams"];
if (_keyNumber in [DIK_LSHIFT, DIK_RSHIFT]) then {TRACE_1("setting shift", _keyParams); _keyParams set [0, true];};
if (_keyNumber in [DIK_LCONTROL, DIK_RCONTROL]) then {TRACE_1("setting ctrl", _keyParams); _keyParams set [1, true];};
if (_keyNumber in [DIK_LMENU, DIK_RMENU]) then {TRACE_1("setting alt", _keyParams); _keyParams set [2, true];};

_keybind = nil;

// Get a local copy of the keybind registry.
Expand Down
2 changes: 2 additions & 0 deletions addons/keybinding/script_component.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
#include "\x\cba\addons\main\script_mod.hpp"
#include "\x\cba\addons\main\script_macros.hpp"

#include "\a3\ui_f\hpp\defineDIKCodes.inc"

//#define DEBUG_ENABLED_KEYBINDING

#ifdef DEBUG_ENABLED_KEYBINDING
Expand Down