dayz_spaceInterrupt = {
private "_handled";
_dikCode = _this select 1;
_shiftState = _this select 2;
_ctrlState = _this select 3;
_altState = _this select 4;
_handled = false;
// Disable ESC after death (not sure if needed but it's here to make sure)
if (_dikCode == 0x01 && r_player_dead) then {
_handled = true;
};
switch (_dikCode) do {
case 0x02: {
["rifle"] spawn player_switchWeapon;
_handled = true;
};
case 0x03: {
["pistol"] spawn player_switchWeapon;
_handled = true;
};
case 0x04: {
["melee"] spawn player_switchWeapon;
_handled = true;
};
default {
if (_dikCode in [0x58,0x57,0x44,0x43,0x42,0x41,0x40,0x3F,0x3E,0x3D,0x3C,0x3B,0x0B,0x0A,0x09,0x08,0x07,0x06,0x05]) then {
_handled = true;
};
};
};
if ((_dikCode in actionKeys "Gear") and (vehicle player != player) and !_shiftState and !_ctrlState and !_altState && !dialog) then {
createGearDialog [player, "RscDisplayGear"];
_handled = true;
};
//if (_dikCode in actionKeys 'MoveForward' or _dikCode in actionKeys 'MoveBack') then {r_interrupt = true};
//Prevent exploit of drag body
if ((_dikCode in actionKeys "Prone") and r_drag_sqf) then { force_dropBody = true; };
if ((_dikCode in actionKeys "Crouch") and r_drag_sqf) then { force_dropBody = true; };
if (_dikCode in actionKeys "MoveLeft") then {r_interrupt = true};
if (_dikCode in actionKeys "MoveRight") then {r_interrupt = true};
if (_dikCode in actionKeys "MoveForward") then {r_interrupt = true};
if (_dikCode in actionKeys "MoveBack") then {r_interrupt = true};
if (_dikCode in actionKeys "ForceCommandingMode") then {_handled = true};
if (_dikCode in actionKeys "PushToTalk" and (time - dayz_lastCheckBit > 10)) then {
dayz_lastCheckBit = time;
[player,15,true,(getPosATL player)] call player_alertZombies;
};
if (_dikCode in actionKeys "VoiceOverNet" and (time - dayz_lastCheckBit > 10)) then {
dayz_lastCheckBit = time;
[player,15,true,(getPosATL player)] call player_alertZombies;
};
if (_dikCode in actionKeys "PushToTalkDirect" and (time - dayz_lastCheckBit > 10)) then {
dayz_lastCheckBit = time;
[player,5,false,(getPosATL player)] call player_alertZombies;
};
if (_dikCode in actionKeys "Chat" and (time - dayz_lastCheckBit > 10)) then {
dayz_lastCheckBit = time;
[player,15,false,(getPosATL player)] call player_alertZombies;
};
if (_dikCode in actionKeys "User20" or _dikCode in actionKeys "NetworkStats") then {
if (!dayz_isSwimming and !dialog) then {
[player,4,true,(getPosATL player)] call player_alertZombies;
createDialog "horde_journal_front_cover";
};
_handled = true;
};
if ((_dikCode in [0x3E,0x0F,0xD3]) and (time - dayz_lastCheckBit > 10)) then {
dayz_lastCheckBit = time;
call player_forceSave;
};
if (_dikCode in [0xB8,0x38,0x3E,0x2A,0x36,0x01]) then {
_displayg = findDisplay 106;
if (!isNull _displayg) then {
call player_forceSave;
} else {
if (dialog) then {
call player_forceSave;
};
};
};
_object = player getVariable ["constructionObject", objNull];
if (!isNull _object and _dikCode in actionKeys "LeanLeft") then {
_dir = getDir _object - 3;
_object setDir _dir;
_handled = true;
};
if (!isNull _object and _dikCode in actionKeys "LeanRight") then {
_dir = getDir _object + 3;
_object setDir _dir;
_handled = true;
};
//Move Down NumPad 2
if (!isNull _object and _dikCode == 0x50) then {
_object setPos [ getPos _object select 0, getPos _object select 1, (getPos _object select 2) - 1];
_handled = true;
};
//Move Up NumPad 8
if (!isNull _object and _dikCode == 0x48) then {
_object setPos [ getPos _object select 0, getPos _object select 1, (getPos _object select 2) + 1];
_handled = true;
};
//Rotate Left NumPad 7
if (!isNull _object and _dikCode == 0x47) then {
_dir = getDir _object - 3;
_object setDir _dir;
_handled = true;
};
//Rotate Right NumPad 9
if (!isNull _object and _dikCode == 0x49) then {
_dir = getDir _object + 3;
_object setDir _dir;
_handled = true;
};
if ((_dikCode == 0xDB) or (_dikCode == 0xDC)) then {
if (tagname) then {tagname = false;} else {tagname = true;};
};
if (_dikCode == 0x9D) then {
if (dialog) then {closeDialog 0;groupManagementActive = false;} else {createGearDialog [player, "RscDisplayGear"];[] execVM "dzgm\loadGroupManagement.sqf";};
};
// Craft Menu Button
if (_dikCode == 0x58) then {
if (dialog) then {closeDialog 0;} else { createDialog "RscDisplayCraftingMenu";};
};
_handled
};