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();
111 proto native
bool IsEnabledMouseAndKeyboardEvenOnServer();
117 proto native
bool IsMouseConnected();
118 proto native
bool IsKeyboardConnected();
121 proto native
int GetCurrentProfile();
123 proto native
void GetCurrentProfileActionKeys(
int action_index, out
TIntArray keys);
125 proto
int GetProfileName(
int profile_index, out
string name);
127 proto native
int GetProfilesCount();
129 proto native
int SetProfile(
int index);
133 proto native
int GetDevicesCount();
134 proto
int GetDeviceName(
int device_index, out
string name);
135 proto native
int IsDeviceXInput(
int device_index);
136 proto native
int IsDeviceEnabled(
int device_index);
137 proto native
void SetDeviceEnabled(
int device_index,
bool enabled);
140 proto
bool GetGamepadThumbDirection(
GamepadButton thumbButton, out
float angle, out
float value);
143 proto native
void ResetActiveGamepad();
144 proto native
void SelectActiveGamepad(
int gamepad);
145 proto native
void GetGamepadList(out
array<int> gamepads);
146 proto
void GetGamepadUser(
int gamepad, out
BiosUser user);
153 proto native
bool IsActiveGamepadSelected();
156 bool IsAnyInputDeviceActive()
158 return IsActiveGamepadSelected() || IsMouseConnected() || IsKeyboardConnected();
165 bool AreAllAllowedInputDevicesActive(out
array<int> unavailableDeviceList =
null)
168 bool gamepad = IsActiveGamepadSelected();
169 bool mouse = IsMouseConnected();
170 bool keyboard = IsKeyboardConnected();
173 if (
g_Game.GetGameState() != DayZGameState.IN_GAME)
175 MnKEnabled = IsEnabledMouseAndKeyboard();
177 else if (
g_Game.GetGameState() != DayZGameState.MAIN_MENU)
179 MnKEnabled = IsEnabledMouseAndKeyboardEvenOnServer();
191 FillUnavailableDeviceArray(EUAINPUT_DEVICE_CONTROLLER,unavailableDeviceList);
201 FillUnavailableDeviceArray(EUAINPUT_DEVICE_MOUSE,unavailableDeviceList);
206 FillUnavailableDeviceArray(EUAINPUT_DEVICE_KEYBOARD,unavailableDeviceList);
211 FillUnavailableDeviceArray(EUAINPUT_DEVICE_CONTROLLER,unavailableDeviceList);
218 void FillUnavailableDeviceArray(
int device, inout
array<int> filler)
222 filler.Insert(device);
227 void UpdateConnectedInputDeviceList()
229 g_Game.GetConnectedInputDeviceList().Clear();
231 if (IsActiveGamepadSelected())
232 g_Game.GetConnectedInputDeviceList().Insert(EUAINPUT_DEVICE_CONTROLLER);
233 if (IsMouseConnected())
234 g_Game.GetConnectedInputDeviceList().Insert(EUAINPUT_DEVICE_MOUSE);
235 if (IsKeyboardConnected())
236 g_Game.GetConnectedInputDeviceList().Insert(EUAINPUT_DEVICE_KEYBOARD);
253 void OnGamepadConnected(
int gamepad)
257 GetGamepadUser( gamepad, user );
258 if (user && user ==
GetGame().GetUserManager().GetSelectedUser())
260 SelectActiveGamepad(gamepad);
262 GetGame().GetMission().GetOnInputDeviceConnected().Invoke(EUAINPUT_DEVICE_CONTROLLER);
267 if (gamepad ==
g_Game.GetPreviousGamepad())
269 SelectActiveGamepad(
g_Game.GetPreviousGamepad());
271 GetGame().GetMission().GetOnInputDeviceConnected().Invoke(EUAINPUT_DEVICE_CONTROLLER);
277 void OnGamepadDisconnected(
int gamepad)
279 if (IsInactiveGamepadOrUserSelected(gamepad))
281 UpdateConnectedInputDeviceList();
285 DayZLoadState state =
g_Game.GetLoadState();
286 if (state != DayZLoadState.MAIN_MENU_START && state != DayZLoadState.MAIN_MENU_USER_SELECT)
289 GetGame().GetMission().GetOnInputDeviceDisconnected().Invoke(EUAINPUT_DEVICE_CONTROLLER);
296 void OnGamepadIdentification(
int gamepad)
300 DayZLoadState state =
g_Game.GetLoadState();
302 UpdateConnectedInputDeviceList();
303 SelectActiveGamepad(gamepad);
304 g_Game.SelectUser(gamepad);
305 g_Game.SetPreviousGamepad(gamepad);
306 if (state == DayZLoadState.MAIN_MENU_START || state == DayZLoadState.MAIN_MENU_USER_SELECT)
309 GetGame().GetMission().Reset();
313 GetGame().GetMission().GetOnInputDeviceConnected().Invoke(EUAINPUT_DEVICE_CONTROLLER);
320 GetGamepadList( gamepads );
321 for(
int i = 0; i < gamepads.Count(); i++ )
324 GetGamepadUser( gamepads[i], user2 );
331 bool IsInactiveGamepadOrUserSelected(
int gamepad = -1 )
334 return !IsActiveGamepadSelected();
338 GetGamepadUser( gamepad, user );
339 return (user ==
GetGame().GetUserManager().GetSelectedUser());
346 void OnMouseConnected()
348 UpdateConnectedInputDeviceList();
351 DayZLoadState state =
g_Game.GetLoadState();
352 if (state != DayZLoadState.MAIN_MENU_START && state != DayZLoadState.MAIN_MENU_USER_SELECT)
354 GetGame().GetMission().GetOnInputDeviceConnected().Invoke(EUAINPUT_DEVICE_MOUSE);
361 void OnMouseDisconnected()
363 UpdateConnectedInputDeviceList();
366 DayZLoadState state =
g_Game.GetLoadState();
367 if (state != DayZLoadState.MAIN_MENU_START && state != DayZLoadState.MAIN_MENU_USER_SELECT)
369 GetGame().GetMission().GetOnInputDeviceDisconnected().Invoke(EUAINPUT_DEVICE_MOUSE);
376 void OnKeyboardConnected()
378 UpdateConnectedInputDeviceList();
381 DayZLoadState state =
g_Game.GetLoadState();
382 if (state != DayZLoadState.MAIN_MENU_START && state != DayZLoadState.MAIN_MENU_USER_SELECT)
384 GetGame().GetMission().GetOnInputDeviceConnected().Invoke(EUAINPUT_DEVICE_KEYBOARD);
391 void OnKeyboardDisconnected()
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_KEYBOARD);
409 GetGame().GetMission().GetOnInputDeviceChanged().Invoke(inputDevice);