-
Content Count
7485 -
Joined
-
Last visited
-
Medals
-
Medals
Single Status Update
-
Pierre I am kind of stuck trying to bind a key like maybe shift+m to my map I am trying to build.
Reference code on page below. Do you have any suggestions or know of any code samples?I have been looking around for examples but have not found any. Kind of lost.
- Show previous comments 10 more
-
toggle the key shift M open, shift M close, shift M open, shift M close,
For that add a variable in your code nil, true, nil true and a condition:
[] spawn {
waituntil {!isNull (findDisplay 46)};
(findDisplay 46) displayAddEventHandler ["keyDown", "_this call your_keyFnc"];
};your_keyFnc = compileFinal "
_ctrl = _this #0;
_dikCode = _this #1;
_shift = _this #2;
_ctrlKey = _this #3;
_alt = _this #4;
private _input = false;if (_shift && !_alt && !_ctrlKey) then {
if (_dikCode == 50) then {
call {
if (isNil "passed") exitWith {
passed = TRUE;
( [ 'myMiniMap' ] call BIS_fnc_rscLayer ) cutRsc [ 'myMap', 'PLAIN', 1, false ];
};
passed = nil;'' cutRsc [ 'myMap', 'PLAIN', 1, false ];
};
_input = true
};
};
_input
";NOTE: the '' cutRsc is not a forget double quote but 2 single quotes. ('+').
not tested. Perhaps there is something to do more due to repetitive key down.
-
I just fixed the errors the map was throwing for the just the map itself. I believe all that is left is to figure out how to close it.
It's getting late here so I will try your code tomorrow.
I really want to thank you for helping and for having the patience with questions I really appreciate it.
Super big THANK YOU for your help.
- Show next comments 9 more