2015-01-11 16:42:31 +00:00
|
|
|
/*
|
|
|
|
* Author: commy2
|
|
|
|
*
|
2015-01-12 04:02:33 +00:00
|
|
|
* Get a key code used in ACE key input eh.
|
|
|
|
*
|
2015-01-11 16:42:31 +00:00
|
|
|
* Argument:
|
|
|
|
* 0: Arma DIK code (Number)
|
|
|
|
* 1: Key state for shift left and shift right key (Bool)
|
|
|
|
* 2: Key state for ctrl left and ctrl right key (Bool)
|
|
|
|
* 3: Key state for alt and alt gr key (Bool)
|
2015-01-12 04:02:33 +00:00
|
|
|
*
|
2015-01-11 16:42:31 +00:00
|
|
|
* Return value:
|
|
|
|
* Key code (Number)
|
|
|
|
*/
|
2015-01-13 19:56:02 +00:00
|
|
|
#include "script_component.hpp"
|
2015-01-11 16:42:31 +00:00
|
|
|
|
|
|
|
#define KEY_MODIFIERS [42, 54, 29, 157, 56, 184]
|
|
|
|
|
2015-05-14 18:06:06 +00:00
|
|
|
PARAMS_1(_key);
|
2015-01-11 16:42:31 +00:00
|
|
|
|
|
|
|
if (_key in KEY_MODIFIERS) exitWith {_key};
|
|
|
|
|
|
|
|
if (_this select 1) then {_key = _key + 0.1};
|
|
|
|
if (_this select 2) then {_key = _key + 0.2};
|
|
|
|
if (_this select 3) then {_key = _key + 0.4};
|
|
|
|
|
|
|
|
_key
|