20 proto native
void ChangeGameFocus(
int add,
int input_device = -1);
27 proto native
void ResetGameFocus(
int input_device = -1);
34 proto native
bool HasGameFocus(
int input_device = -1);
37 proto native
int GetActionGroupsCount();
38 proto native
int GetActionGroupSize(
int group_index);
39 proto
int GetActionGroupName(
int group_index, out
string name);
40 proto
int GetActionDesc(
int action_index, out
string desc);
50 proto native
float LocalValue_ID(
int action,
bool check_focus =
true);
51 proto native
float LocalValue(
string action,
bool check_focus =
true);
61 proto native
bool LocalPress_ID(
int action,
bool check_focus =
true);
62 proto native
bool LocalPress(
string action,
bool check_focus =
true);
71 proto native
bool LocalRelease_ID(
int action,
bool check_focus =
true);
72 proto native
bool LocalRelease(
string action,
bool check_focus =
true);
81 proto native
bool LocalHold_ID(
int action,
bool check_focus =
true);
82 proto native
bool LocalHold(
string action,
bool check_focus =
true);
91 proto native
bool LocalDbl_ID(
int action,
bool check_focus =
true);
92 proto native
bool LocalDbl(
string action,
bool check_focus =
true);
101 proto native
void DisableKey(
int key);
104 proto native
void EnableMouseAndKeyboard(
bool enable);
106 proto native
bool IsEnabledMouseAndKeyboard();
109 proto native
void EnableGamepad(
bool enable);
114 proto native
bool IsEnabledGamepad();
119 proto native
bool IsEnabledMouseAndKeyboardEvenOnServer();
125 proto native
bool IsMouseConnected();
126 proto native
bool IsKeyboardConnected();
129 proto native
int GetCurrentProfile();
131 proto native
void GetCurrentProfileActionKeys(
int action_index, out
TIntArray keys);
135 proto native
int GetProfilesCount();
137 proto native
int SetProfile(
int index);
141 proto native
int GetDevicesCount();
142 proto
int GetDeviceName(
int device_index, out
string name);
143 proto native
int IsDeviceXInput(
int device_index);
144 proto native
int IsDeviceEnabled(
int device_index);
145 proto native
void SetDeviceEnabled(
int device_index,
bool enabled);
148 proto
bool GetGamepadThumbDirection(
GamepadButton thumbButton, out
float angle, out
float value);
151 proto native
void ResetActiveGamepad();
152 proto native
void SelectActiveGamepad(
int gamepad);
153 proto native
void GetGamepadList(out
array<int> gamepads);
154 proto
void GetGamepadUser(
int gamepad, out
BiosUser user);
161 proto native
bool IsActiveGamepadSelected();
164 bool IsAnyInputDeviceActive()
166 return IsActiveGamepadSelected() || IsMouseConnected() || IsKeyboardConnected();
173 bool AreAllAllowedInputDevicesActive(out
array<int> unavailableDeviceList = null)
176 bool gamepad = IsActiveGamepadSelected();
177 bool mouse = IsMouseConnected();
178 bool keyboard = IsKeyboardConnected();
181 if (
g_Game.GetGameState() != DayZGameState.IN_GAME)
183 MnKEnabled = IsEnabledMouseAndKeyboard();
185 else if (
g_Game.GetGameState() != DayZGameState.MAIN_MENU)
187 MnKEnabled = IsEnabledMouseAndKeyboardEvenOnServer();
199 FillUnavailableDeviceArray(EUAINPUT_DEVICE_CONTROLLER,unavailableDeviceList);
209 FillUnavailableDeviceArray(EUAINPUT_DEVICE_MOUSE,unavailableDeviceList);
214 FillUnavailableDeviceArray(EUAINPUT_DEVICE_KEYBOARD,unavailableDeviceList);
219 FillUnavailableDeviceArray(EUAINPUT_DEVICE_CONTROLLER,unavailableDeviceList);
226 void FillUnavailableDeviceArray(
int device, inout
array<int> filler)
230 filler.Insert(device);
235 void UpdateConnectedInputDeviceList()
237 g_Game.GetConnectedInputDeviceList().Clear();
239 if (IsActiveGamepadSelected())
240 g_Game.GetConnectedInputDeviceList().Insert(EUAINPUT_DEVICE_CONTROLLER);
241 if (IsMouseConnected())
242 g_Game.GetConnectedInputDeviceList().Insert(EUAINPUT_DEVICE_MOUSE);
243 if (IsKeyboardConnected())
244 g_Game.GetConnectedInputDeviceList().Insert(EUAINPUT_DEVICE_KEYBOARD);
261 void OnGamepadConnected(
int gamepad)
268 GetGamepadUser( gamepad, user );
269 if (user && user ==
GetGame().GetUserManager().GetSelectedUser())
271 SelectActiveGamepad(gamepad);
273 GetGame().GetMission().GetOnInputDeviceConnected().Invoke(EUAINPUT_DEVICE_CONTROLLER);
278 if (gamepad ==
g_Game.GetPreviousGamepad())
280 SelectActiveGamepad(
g_Game.GetPreviousGamepad());
282 GetGame().GetMission().GetOnInputDeviceConnected().Invoke(EUAINPUT_DEVICE_CONTROLLER);
288 void OnGamepadDisconnected(
int gamepad)
293 if (IsInactiveGamepadOrUserSelected(gamepad))
295 UpdateConnectedInputDeviceList();
299 DayZLoadState state =
g_Game.GetLoadState();
300 if (state != DayZLoadState.MAIN_MENU_START && state != DayZLoadState.MAIN_MENU_USER_SELECT)
303 GetGame().GetMission().GetOnInputDeviceDisconnected().Invoke(EUAINPUT_DEVICE_CONTROLLER);
310 void OnGamepadIdentification(
int gamepad)
317 DayZLoadState state =
g_Game.GetLoadState();
319 UpdateConnectedInputDeviceList();
320 SelectActiveGamepad(gamepad);
321 g_Game.SelectUser(gamepad);
322 g_Game.SetPreviousGamepad(gamepad);
323 if (state == DayZLoadState.MAIN_MENU_START || state == DayZLoadState.MAIN_MENU_USER_SELECT)
326 GetGame().GetMission().Reset();
330 GetGame().GetMission().GetOnInputDeviceConnected().Invoke(EUAINPUT_DEVICE_CONTROLLER);
337 GetGamepadList( gamepads );
338 for(
int i = 0; i < gamepads.Count(); i++ )
341 GetGamepadUser( gamepads[i], user2 );
348 bool IsInactiveGamepadOrUserSelected(
int gamepad = -1 )
353 #ifdef PLATFORM_CONSOLE
354 if (!
GetGame().GetUserManager())
357 return !IsActiveGamepadSelected();
361 GetGamepadUser( gamepad, user );
362 return (user ==
GetGame().GetUserManager().GetSelectedUser());
370 void OnMouseConnected()
375 UpdateConnectedInputDeviceList();
378 DayZLoadState state =
g_Game.GetLoadState();
379 if (state != DayZLoadState.MAIN_MENU_START && state != DayZLoadState.MAIN_MENU_USER_SELECT)
381 GetGame().GetMission().GetOnInputDeviceConnected().Invoke(EUAINPUT_DEVICE_MOUSE);
388 void OnMouseDisconnected()
393 UpdateConnectedInputDeviceList();
396 DayZLoadState state =
g_Game.GetLoadState();
397 if (state != DayZLoadState.MAIN_MENU_START && state != DayZLoadState.MAIN_MENU_USER_SELECT)
399 GetGame().GetMission().GetOnInputDeviceDisconnected().Invoke(EUAINPUT_DEVICE_MOUSE);
406 void OnKeyboardConnected()
411 UpdateConnectedInputDeviceList();
414 DayZLoadState state =
g_Game.GetLoadState();
415 if (state != DayZLoadState.MAIN_MENU_START && state != DayZLoadState.MAIN_MENU_USER_SELECT)
417 GetGame().GetMission().GetOnInputDeviceConnected().Invoke(EUAINPUT_DEVICE_KEYBOARD);
424 void OnKeyboardDisconnected()
429 UpdateConnectedInputDeviceList();
432 DayZLoadState state =
g_Game.GetLoadState();
433 if (state != DayZLoadState.MAIN_MENU_START && state != DayZLoadState.MAIN_MENU_USER_SELECT)
435 GetGame().GetMission().GetOnInputDeviceDisconnected().Invoke(EUAINPUT_DEVICE_KEYBOARD);
448 GetGame().GetMission().GetOnInputDeviceChanged().Invoke(inputDevice);