Dayz 1.25
Dayz Code Explorer by KGB
Загрузка...
Поиск...
Не найдено
Класс Input

Закрытые члены

proto native void ChangeGameFocus (int add, int input_device=-1)
 Change game focus number.
 
proto native void ResetGameFocus (int input_device=-1)
 Reset game focus number (set to 0)
 
proto native bool HasGameFocus (int input_device=-1)
 Check if game should have focus.
 
proto native int GetActionGroupsCount ()
 
proto native int GetActionGroupSize (int group_index)
 
proto int GetActionGroupName (int group_index, out string name)
 
proto int GetActionDesc (int action_index, out string desc)
 
proto native float LocalValue_ID (int action, bool check_focus=true)
 Get action state.
 
proto native float LocalValue (string action, bool check_focus=true)
 
proto native bool LocalPress_ID (int action, bool check_focus=true)
 Returns true just in frame, when action was invoked (button was pressed)
 
proto native bool LocalPress (string action, bool check_focus=true)
 
proto native bool LocalRelease_ID (int action, bool check_focus=true)
 Returns true just in frame, when release action happened (button was released)
 
proto native bool LocalRelease (string action, bool check_focus=true)
 
proto native bool LocalHold_ID (int action, bool check_focus=true)
 Returns true just in frame, when hold action invoked (button is hold)
 
proto native bool LocalHold (string action, bool check_focus=true)
 
proto native bool LocalDbl_ID (int action, bool check_focus=true)
 Returns true just in frame, when double click action invoked (button double clicked)
 
proto native bool LocalDbl (string action, bool check_focus=true)
 
proto native void DisableKey (int key)
 Disable key until end of frame.
 
proto native void EnableMouseAndKeyboard (bool enable)
 Enable mouse and keyboard (on consoles)
 
proto native bool IsEnabledMouseAndKeyboard ()
 
proto native bool IsEnabledMouseAndKeyboardEvenOnServer ()
 
proto native bool IsMouseConnected ()
 
proto native bool IsKeyboardConnected ()
 
proto native int GetCurrentProfile ()
 gets currently selected profile
 
proto native void GetCurrentProfileActionKeys (int action_index, out TIntArray keys)
 
proto int GetProfileName (int profile_index, out string name)
 gets profile by index
 
proto native int GetProfilesCount ()
 gets profile by name
 
proto native int SetProfile (int index)
 setting active profile
 
proto native int GetDevicesCount ()
 
proto int GetDeviceName (int device_index, out string name)
 
proto native int IsDeviceXInput (int device_index)
 
proto native int IsDeviceEnabled (int device_index)
 
proto native void SetDeviceEnabled (int device_index, bool enabled)
 
proto bool GetGamepadThumbDirection (GamepadButton thumbButton, out float angle, out float value)
 return true if was deflected button.
 
proto native void ResetActiveGamepad ()
 clears active gamepad
 
proto native void SelectActiveGamepad (int gamepad)
 
proto native void GetGamepadList (out array< int > gamepads)
 
proto void GetGamepadUser (int gamepad, out BiosUser user)
 
proto native void IdentifyGamepad (GamepadButton button)
 the on OnGamepadIdentification callback will return the first gamepad where the button was pressed
 
proto native bool IsActiveGamepadSelected ()
 returns true if there is an active gamepad selected.
 
bool IsAnyInputDeviceActive ()
 returns true if 'Gamepad' or 'Mouse and Keyboard' is connected
 
bool AreAllAllowedInputDevicesActive (out array< int > unavailableDeviceList=null)
 returns true if 'Gamepad' or if 'Mouse/Keyboard' control is allowed locally and on server, and the respective input devicse are connected. Gamepad takes priority.
 
void FillUnavailableDeviceArray (int device, inout array< int > filler)
 
void UpdateConnectedInputDeviceList ()
 currently lists only available Gamepad, Mouse, and Keyboard. Extendable as needed.
 
proto native EInputDeviceType GetCurrentInputDevice ()
 
proto native GamepadButton GetEnterButton ()
 
void OnGamepadConnected (int gamepad)
 callback that is fired when a new gamepad is connected
 
void OnGamepadDisconnected (int gamepad)
 callback that is fired when gamepad is disconnected
 
void OnGamepadIdentification (int gamepad)
 callback that is fired when identification was requested
 
int GetUserGamepad (BiosUser user)
 
bool IsInactiveGamepadOrUserSelected (int gamepad=-1)
 
void OnMouseConnected ()
 
void OnMouseDisconnected ()
 
void OnKeyboardConnected ()
 
void OnKeyboardDisconnected ()
 
void OnLastInputDeviceChanged (EInputDeviceType inputDevice)
 called from code on different input device use
 

Подробное описание

Методы

◆ AreAllAllowedInputDevicesActive()

bool AreAllAllowedInputDevicesActive ( out array< int > unavailableDeviceList = null)
inlineprivate

returns true if 'Gamepad' or if 'Mouse/Keyboard' control is allowed locally and on server, and the respective input devicse are connected. Gamepad takes priority.

Аргументы
unavailableDeviceListlists all devices that SHOULD be available, but aren't. Optional.
166 {
167 bool passed = true;
169 bool mouse = IsMouseConnected();
171 bool MnKEnabled;
172
173 if (g_Game.GetGameState() != DayZGameState.IN_GAME)
174 {
176 }
177 else if (g_Game.GetGameState() != DayZGameState.MAIN_MENU)
178 {
180 }
181 else
182 {
183 return true;
184 }
185
186 if (!MnKEnabled)
187 {
188 if (!gamepad)
189 {
190 passed = false;
192 }
193 }
194 else
195 {
196 if (!gamepad)
197 {
198 if (!mouse)
199 {
200 passed = false;
202 }
203 if (!keyboard)
204 {
205 passed = false;
207 }
208
209 if (!passed)
210 {
212 }
213 }
214 }
215 return passed;
216 }
DayZGame g_Game
Definition DayZGame.c:3746
proto native bool IsMouseConnected()
proto native bool IsKeyboardConnected()
void FillUnavailableDeviceArray(int device, inout array< int > filler)
Definition input.c:218
proto native bool IsEnabledMouseAndKeyboardEvenOnServer()
proto native bool IsEnabledMouseAndKeyboard()
proto native bool IsActiveGamepadSelected()
returns true if there is an active gamepad selected.
Definition EntityAI.c:95

Перекрестные ссылки FillUnavailableDeviceArray(), g_Game, IsActiveGamepadSelected(), IsEnabledMouseAndKeyboard(), IsEnabledMouseAndKeyboardEvenOnServer(), IsKeyboardConnected() и IsMouseConnected().

◆ ChangeGameFocus()

proto native void ChangeGameFocus ( int add,
int input_device = -1 )
private

Change game focus number.

Аргументы
addnumber to add to focus number
input_deviceif equals -1, works globally on all devices, see INPUT_DEVICE_* values in constants.h
См. также
HasGameFocus()

◆ DisableKey()

proto native void DisableKey ( int key)
private

Disable key until end of frame.

Аргументы
keyid of key, defined in KeyCode
GetGame().GetInput().DisableKey(KeyCode.KC_RETURN);
proto native CGame GetGame()
KeyCode
Definition EnSystem.c:157

◆ EnableMouseAndKeyboard()

proto native void EnableMouseAndKeyboard ( bool enable)
private

Enable mouse and keyboard (on consoles)

◆ FillUnavailableDeviceArray()

void FillUnavailableDeviceArray ( int device,
inout array< int > filler )
inlineprivate
219 {
220 if (filler)
221 {
222 filler.Insert(device);
223 }
224 }

Используется в AreAllAllowedInputDevicesActive().

◆ GetActionDesc()

proto int GetActionDesc ( int action_index,
out string desc )
private

◆ GetActionGroupName()

proto int GetActionGroupName ( int group_index,
out string name )
private

◆ GetActionGroupsCount()

proto native int GetActionGroupsCount ( )
private

◆ GetActionGroupSize()

proto native int GetActionGroupSize ( int group_index)
private

◆ GetCurrentInputDevice()

proto native EInputDeviceType GetCurrentInputDevice ( )
private
Возвращает
Input device, with the last input event ('mouse and keyboard', 'controller' or 'unknown' if none input event was fired from the beginning).

◆ GetCurrentProfile()

proto native int GetCurrentProfile ( )
private

gets currently selected profile

◆ GetCurrentProfileActionKeys()

proto native void GetCurrentProfileActionKeys ( int action_index,
out TIntArray keys )
private

◆ GetDeviceName()

proto int GetDeviceName ( int device_index,
out string name )
private

◆ GetDevicesCount()

proto native int GetDevicesCount ( )
private

◆ GetEnterButton()

proto native GamepadButton GetEnterButton ( )
private
Заметки
For PlayStation, Enter button in Asia territory is typically Circle button (B button), but in Europe and America it is Cross button (A button).
Возвращает
Button, which represent Enter/Accept button.

◆ GetGamepadList()

proto native void GetGamepadList ( out array< int > gamepads)
private

Используется в GetUserGamepad().

◆ GetGamepadThumbDirection()

proto bool GetGamepadThumbDirection ( GamepadButton thumbButton,
out float angle,
out float value )
private

return true if was deflected button.

◆ GetGamepadUser()

proto void GetGamepadUser ( int gamepad,
out BiosUser user )
private

◆ GetProfileName()

proto int GetProfileName ( int profile_index,
out string name )
private

gets profile by index

◆ GetProfilesCount()

proto native int GetProfilesCount ( )
private

gets profile by name

◆ GetUserGamepad()

int GetUserGamepad ( BiosUser user)
inlineprivate
318 {
321 for( int i = 0; i < gamepads.Count(); i++ )
322 {
325 if( user == user2 )
326 return gamepads[i];
327 }
328 return -1;
329 }
Definition BiosUserManager.c:9
proto native void GetGamepadList(out array< int > gamepads)
proto void GetGamepadUser(int gamepad, out BiosUser user)

Перекрестные ссылки GetGamepadList() и GetGamepadUser().

◆ HasGameFocus()

proto native bool HasGameFocus ( int input_device = -1)
private

Check if game should have focus.

Аргументы
input_deviceif equals -1, checks all devices, see INPUT_DEVICE_* values in constants.h
Возвращает
true if focus number == 0, false otherwise

◆ IdentifyGamepad()

proto native void IdentifyGamepad ( GamepadButton button)
private

the on OnGamepadIdentification callback will return the first gamepad where the button was pressed

Аргументы
buttonthe button that needs to be pressed for the identification

◆ IsActiveGamepadSelected()

proto native bool IsActiveGamepadSelected ( )
private

returns true if there is an active gamepad selected.

Используется в AreAllAllowedInputDevicesActive(), IsAnyInputDeviceActive(), IsInactiveGamepadOrUserSelected() и UpdateConnectedInputDeviceList().

◆ IsAnyInputDeviceActive()

bool IsAnyInputDeviceActive ( )
inlineprivate

returns true if 'Gamepad' or 'Mouse and Keyboard' is connected

157 {
159 }

Перекрестные ссылки IsActiveGamepadSelected(), IsKeyboardConnected() и IsMouseConnected().

◆ IsDeviceEnabled()

proto native int IsDeviceEnabled ( int device_index)
private

◆ IsDeviceXInput()

proto native int IsDeviceXInput ( int device_index)
private

◆ IsEnabledMouseAndKeyboard()

proto native bool IsEnabledMouseAndKeyboard ( )
private
Возвращает
state of support mouse and keyboard (on consoles)

Используется в AreAllAllowedInputDevicesActive().

◆ IsEnabledMouseAndKeyboardEvenOnServer()

proto native bool IsEnabledMouseAndKeyboardEvenOnServer ( )
private
Возвращает
state of support mouse and keyboard. If client playing on server where mouse and keyboard is disabled, then return false. (on consoles)

Используется в AreAllAllowedInputDevicesActive().

◆ IsInactiveGamepadOrUserSelected()

bool IsInactiveGamepadOrUserSelected ( int gamepad = -1)
inlineprivate
332 {
333 #ifdef PLATFORM_XBOX
334 return !IsActiveGamepadSelected();
335 #endif
336 #ifdef PLATFORM_PS4
339 return (user == GetGame().GetUserManager().GetSelectedUser());
340 #endif
341 return false;
342 }

Перекрестные ссылки GetGame(), GetGamepadUser() и IsActiveGamepadSelected().

Используется в OnGamepadDisconnected().

◆ IsKeyboardConnected()

proto native bool IsKeyboardConnected ( )
private

◆ IsMouseConnected()

proto native bool IsMouseConnected ( )
private
Возвращает
Console: Last state queried from the platform operating system for the active gamepad. PC: Always true.

Используется в AreAllAllowedInputDevicesActive(), IsAnyInputDeviceActive() и UpdateConnectedInputDeviceList().

◆ LocalDbl()

proto native bool LocalDbl ( string action,
bool check_focus = true )
private

◆ LocalDbl_ID()

proto native bool LocalDbl_ID ( int action,
bool check_focus = true )
private

Returns true just in frame, when double click action invoked (button double clicked)

Аргументы
actionid of action, defined in 4_World/Classes/UserActionsComponent/_constants.c
check_focusif true and game is unfocused, returns 0; otherwise returns actual value
Возвращает
true if action was released in that frame, false otherwise
См. также
LocalDbl()

◆ LocalHold()

proto native bool LocalHold ( string action,
bool check_focus = true )
private

◆ LocalHold_ID()

proto native bool LocalHold_ID ( int action,
bool check_focus = true )
private

Returns true just in frame, when hold action invoked (button is hold)

Аргументы
actionid of action, defined in 4_World/Classes/UserActionsComponent/_constants.c
check_focusif true and game is unfocused, returns 0; otherwise returns actual value
Возвращает
true if action was released in that frame, false otherwise
См. также
LocalHold()

◆ LocalPress()

proto native bool LocalPress ( string action,
bool check_focus = true )
private

◆ LocalPress_ID()

proto native bool LocalPress_ID ( int action,
bool check_focus = true )
private

Returns true just in frame, when action was invoked (button was pressed)

Заметки
if the input is limited (click, hold, doubleclick), 'Press' event is limited as well, and reacts to the limiter only! Otherwise it registeres the first event, usually 'press' (change of value from 0)
Аргументы
actionid of action, defined in 4_World/Classes/UserActionsComponent/_constants.c
check_focusif true and game is unfocused, returns 0; otherwise returns actual value
Возвращает
true if action was invoked in that frame, false otherwise
См. также
LocalPress()

◆ LocalRelease()

proto native bool LocalRelease ( string action,
bool check_focus = true )
private

◆ LocalRelease_ID()

proto native bool LocalRelease_ID ( int action,
bool check_focus = true )
private

Returns true just in frame, when release action happened (button was released)

Аргументы
actionid of action, defined in 4_World/Classes/UserActionsComponent/_constants.c
check_focusif true and game is unfocused, returns 0; otherwise returns actual value
Возвращает
true if action was released in that frame, false otherwise
См. также
LocalRelease()

◆ LocalValue()

proto native float LocalValue ( string action,
bool check_focus = true )
private

◆ LocalValue_ID()

proto native float LocalValue_ID ( int action,
bool check_focus = true )
private

Get action state.

Аргументы
actionid of action, defined in 4_World/Classes/UserActionsComponent/_constants.c
check_focusif true and game is unfocused, returns 0; otherwise returns actual value
Возвращает
actual action state as float, for regular two state buttons returns 0 or 1, for analog buttons/axes returns value in interval <0, 1> with consideration of defined deadzones
См. также
LocalValue()

◆ OnGamepadConnected()

void OnGamepadConnected ( int gamepad)
inlineprivate

callback that is fired when a new gamepad is connected

254 {
255 #ifdef PLATFORM_PS4
258 if (user && user == GetGame().GetUserManager().GetSelectedUser())
259 {
261 if (GetGame().GetMission())
262 GetGame().GetMission().GetOnInputDeviceConnected().Invoke(EUAINPUT_DEVICE_CONTROLLER); //only for PS, xbox handles it on identification
263 }
264 #endif
265
266 #ifdef PLATFORM_XBOX
267 if (gamepad == g_Game.GetPreviousGamepad())
268 {
269 SelectActiveGamepad(g_Game.GetPreviousGamepad());
270 if (GetGame().GetMission())
271 GetGame().GetMission().GetOnInputDeviceConnected().Invoke(EUAINPUT_DEVICE_CONTROLLER); //only for PS, xbox handles it on identification
272 }
273 #endif
274 }
proto native void SelectActiveGamepad(int gamepad)

Перекрестные ссылки g_Game, GetGame(), GetGamepadUser() и SelectActiveGamepad().

◆ OnGamepadDisconnected()

void OnGamepadDisconnected ( int gamepad)
inlineprivate

callback that is fired when gamepad is disconnected

278 {
280 {
282
283 if (!g_Game.IsLoading())
284 {
285 DayZLoadState state = g_Game.GetLoadState();
286 if (state != DayZLoadState.MAIN_MENU_START && state != DayZLoadState.MAIN_MENU_USER_SELECT)
287 {
288 if (GetGame().GetMission())
289 GetGame().GetMission().GetOnInputDeviceDisconnected().Invoke(EUAINPUT_DEVICE_CONTROLLER);
290 }
291 }
292 }
293 }
void UpdateConnectedInputDeviceList()
currently lists only available Gamepad, Mouse, and Keyboard. Extendable as needed.
Definition input.c:227
bool IsInactiveGamepadOrUserSelected(int gamepad=-1)
Definition input.c:331

Перекрестные ссылки g_Game, GetGame(), IsInactiveGamepadOrUserSelected() и UpdateConnectedInputDeviceList().

◆ OnGamepadIdentification()

void OnGamepadIdentification ( int gamepad)
inlineprivate

callback that is fired when identification was requested

297 {
298 if (gamepad > -1)
299 {
300 DayZLoadState state = g_Game.GetLoadState();
301
304 g_Game.SelectUser(gamepad);
305 g_Game.SetPreviousGamepad(gamepad);
306 if (state == DayZLoadState.MAIN_MENU_START || state == DayZLoadState.MAIN_MENU_USER_SELECT)
307 {
308 if (GetGame().GetMission())
309 GetGame().GetMission().Reset();
310 }
311
312 if (GetGame() && GetGame().GetMission() && GetGame().GetMission().GetOnInputDeviceConnected())
313 GetGame().GetMission().GetOnInputDeviceConnected().Invoke(EUAINPUT_DEVICE_CONTROLLER);
314 }
315 }

Перекрестные ссылки g_Game, GetGame(), SelectActiveGamepad() и UpdateConnectedInputDeviceList().

◆ OnKeyboardConnected()

void OnKeyboardConnected ( )
inlineprivate

callback that is fired when keyboard is connected (PS: and assigned to the user) does not fire on PC - mouse/keyboard assumed to always be connected

377 {
379 if (!g_Game.IsLoading() && GetGame().GetMission())
380 {
381 DayZLoadState state = g_Game.GetLoadState();
382 if (state != DayZLoadState.MAIN_MENU_START && state != DayZLoadState.MAIN_MENU_USER_SELECT)
383 {
384 GetGame().GetMission().GetOnInputDeviceConnected().Invoke(EUAINPUT_DEVICE_KEYBOARD);
385 }
386 }
387 }

Перекрестные ссылки g_Game, GetGame() и UpdateConnectedInputDeviceList().

◆ OnKeyboardDisconnected()

void OnKeyboardDisconnected ( )
inlineprivate

callback that is fired when keyboard is disconnected does not fire on PC - mouse/keyboard assumed to always be connected

392 {
394 if (!g_Game.IsLoading() && GetGame().GetMission())
395 {
396 DayZLoadState state = g_Game.GetLoadState();
397 if (state != DayZLoadState.MAIN_MENU_START && state != DayZLoadState.MAIN_MENU_USER_SELECT)
398 {
399 GetGame().GetMission().GetOnInputDeviceDisconnected().Invoke(EUAINPUT_DEVICE_KEYBOARD);
400 }
401 }
402 }

Перекрестные ссылки g_Game, GetGame() и UpdateConnectedInputDeviceList().

◆ OnLastInputDeviceChanged()

void OnLastInputDeviceChanged ( EInputDeviceType inputDevice)
inlineprivate

called from code on different input device use

406 {
407 if (GetGame().GetMission())
408 {
409 GetGame().GetMission().GetOnInputDeviceChanged().Invoke(inputDevice);
410 }
411 }

Перекрестные ссылки GetGame().

◆ OnMouseConnected()

void OnMouseConnected ( )
inlineprivate

callback that is fired when mouse is connected (PS: and assigned to the user) does not fire on PC - mouse/keyboard assumed to always be connected

347 {
349 if (!g_Game.IsLoading() && GetGame().GetMission())
350 {
351 DayZLoadState state = g_Game.GetLoadState();
352 if (state != DayZLoadState.MAIN_MENU_START && state != DayZLoadState.MAIN_MENU_USER_SELECT)
353 {
354 GetGame().GetMission().GetOnInputDeviceConnected().Invoke(EUAINPUT_DEVICE_MOUSE);
355 }
356 }
357 }

Перекрестные ссылки g_Game, GetGame() и UpdateConnectedInputDeviceList().

◆ OnMouseDisconnected()

void OnMouseDisconnected ( )
inlineprivate

callback that is fired when mouse is disconnected does not fire on PC - mouse/keyboard assumed to always be connected

362 {
364 if (!g_Game.IsLoading() && GetGame().GetMission())
365 {
366 DayZLoadState state = g_Game.GetLoadState();
367 if (state != DayZLoadState.MAIN_MENU_START && state != DayZLoadState.MAIN_MENU_USER_SELECT)
368 {
369 GetGame().GetMission().GetOnInputDeviceDisconnected().Invoke(EUAINPUT_DEVICE_MOUSE);
370 }
371 }
372 }

Перекрестные ссылки g_Game, GetGame() и UpdateConnectedInputDeviceList().

◆ ResetActiveGamepad()

proto native void ResetActiveGamepad ( )
private

clears active gamepad

◆ ResetGameFocus()

proto native void ResetGameFocus ( int input_device = -1)
private

Reset game focus number (set to 0)

Аргументы
input_deviceif equals -1, works globally on all devices, see INPUT_DEVICE_* values in constants.h
См. также
HasGameFocus()

◆ SelectActiveGamepad()

proto native void SelectActiveGamepad ( int gamepad)
private

Используется в OnGamepadConnected() и OnGamepadIdentification().

◆ SetDeviceEnabled()

proto native void SetDeviceEnabled ( int device_index,
bool enabled )
private

◆ SetProfile()

proto native int SetProfile ( int index)
private

setting active profile

◆ UpdateConnectedInputDeviceList()

void UpdateConnectedInputDeviceList ( )
inlineprivate

currently lists only available Gamepad, Mouse, and Keyboard. Extendable as needed.

228 {
229 g_Game.GetConnectedInputDeviceList().Clear();
230
232 g_Game.GetConnectedInputDeviceList().Insert(EUAINPUT_DEVICE_CONTROLLER);
233 if (IsMouseConnected())
234 g_Game.GetConnectedInputDeviceList().Insert(EUAINPUT_DEVICE_MOUSE);
236 g_Game.GetConnectedInputDeviceList().Insert(EUAINPUT_DEVICE_KEYBOARD);
237 }

Перекрестные ссылки g_Game, IsActiveGamepadSelected(), IsKeyboardConnected() и IsMouseConnected().

Используется в OnGamepadDisconnected(), OnGamepadIdentification(), OnKeyboardConnected(), OnKeyboardDisconnected(), OnMouseConnected() и OnMouseDisconnected().


Объявления и описания членов класса находятся в файле: