Spacebar scanner/range finder

Mr.Weegley

Member
Hello there!
After digging deep and totally breaking my brain, i have, at last, solved how to fix "Spacebar scanner".
If you know what is it, and already disabled it, pls don't hesitate to post here your solution.
I'll post mine.
As sometimes with programming/scripting it happened to be simple.
So, the problem was to disable target info/range displayed upon pressing spacebar, or whatsever key is assigned for "Command Menu":
Strange, but first solution i found was not working. It was an idea of putting next code into init.sqf:
Code:
player setVariable ["BIS_noCoreConversations", true];
player disableConversation true;
So, this didn't work for me. Next weeks any attempt to find solution was hopeless. But today i found next code inside compiles.sqf:
Code:
        if (_dikCode in actionKeys "ForceCommandingMode") then {                    _handled = true;};
As far as i understand, this should solve problem, but after i put any code before _handled = true; i found that this portion of code just not executed.
Ok, too much unnecessary words.

My working solution:

Bottom of init.sqf:
Code:
if (!isDedicated) then
        {
            onKeyPress = compile preprocessFile "scripts\onKeyPress.sqf";
            waituntil {!(IsNull (findDisplay 46))};
            _display = findDisplay 46;
            _display displaySetEventHandler ["KeyDown", "_this call onKeyPress"];
        };

scripts\onKeyPress.sqf:
Code:
private["_handled", "_ctrl", "_dikCode", "_shift", "_ctrlKey", "_alt"];
_ctrl = _this select 0;
_dikCode = _this select 1;
_shift = _this select 2;
_ctrlKey = _this select 3;
_alt = _this select 4;

_handled = false;
    if (_dikCode in (actionKeys "ForceCommandingMode")) then
    {
        player sideChat localize "STR_Spacebar";
        _handled = true;
    };
_handled

Actually, i found this code here

BUT
Still we have the same magic thing when scrolling wheel down :(
 
Last edited:
Back
Top