Dayz Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Loading...
Searching...
No Matches
Input Class Reference

Private Member Functions

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.
proto native void ChangeGameFocus (int add, int input_device=-1)
 Change game focus number.
proto native void DisableKey (int key)
 Disable key until end of frame.
proto native void EnableGamepad (bool enable)
 Enable gamepad (on PC).
proto native void EnableMouseAndKeyboard (bool enable)
 Enable mouse and keyboard (on consoles).
void FillUnavailableDeviceArray (int device, inout array< int > filler)
proto int GetActionDesc (int action_index, out string desc)
proto int GetActionGroupName (int group_index, out string name)
proto native int GetActionGroupsCount ()
proto native int GetActionGroupSize (int group_index)
proto native EInputDeviceType GetCurrentInputDevice ()
proto native int GetCurrentProfile ()
 gets currently selected profile
proto native void GetCurrentProfileActionKeys (int action_index, out TIntArray keys)
proto int GetDeviceName (int device_index, out string name)
proto native int GetDevicesCount ()
proto native GamepadButton GetEnterButton ()
proto native void GetGamepadList (out array< int > gamepads)
proto bool GetGamepadThumbDirection (GamepadButton thumbButton, out float angle, out float value)
 return true if was deflected button.
proto void GetGamepadUser (int gamepad, out BiosUser user)
proto int GetProfileName (int profile_index, out string name)
 gets profile by index
proto native int GetProfilesCount ()
 gets profile by name
int GetUserGamepad (BiosUser user)
proto native bool HasGameFocus (int input_device=-1)
 Check if game should have focus.
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
proto native int IsDeviceEnabled (int device_index)
proto native int IsDeviceXInput (int device_index)
proto native bool IsEnabledGamepad ()
proto native bool IsEnabledMouseAndKeyboard ()
proto native bool IsEnabledMouseAndKeyboardEvenOnServer ()
bool IsInactiveGamepadOrUserSelected (int gamepad=-1)
proto native bool IsKeyboardConnected ()
proto native bool IsMouseConnected ()
proto native bool LocalDbl (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 LocalHold (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 LocalPress (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 LocalRelease (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 float LocalValue (string action, bool check_focus=true)
proto native float LocalValue_ID (int action, bool check_focus=true)
 Get action state.
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
void OnKeyboardConnected ()
 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
void OnKeyboardDisconnected ()
 callback that is fired when keyboard is disconnected does not fire on PC - mouse/keyboard assumed to always be connected
void OnLastInputDeviceChanged (EInputDeviceType inputDevice)
 called from code on different input device use
void OnMouseConnected ()
 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
void OnMouseDisconnected ()
 callback that is fired when mouse is disconnected does not fire on PC - mouse/keyboard assumed to always be connected
proto native void ResetActiveGamepad ()
 clears active gamepad
proto native void ResetGameFocus (int input_device=-1)
 Reset game focus number (set to 0).
proto native void SelectActiveGamepad (int gamepad)
proto native void SetDeviceEnabled (int device_index, bool enabled)
proto native int SetProfile (int index)
 setting active profile
void UpdateConnectedInputDeviceList ()
 currently lists only available Gamepad, Mouse, and Keyboard. Extendable as needed.

Detailed Description

Definition at line 10 of file input.c.

Member Function Documentation

◆ 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.

Parameters
unavailableDeviceListlists all devices that SHOULD be available, but aren't. Optional.

Definition at line 173 of file input.c.

References FillUnavailableDeviceArray(), g_Game, IsActiveGamepadSelected(), IsEnabledMouseAndKeyboard(), IsEnabledMouseAndKeyboardEvenOnServer(), IsKeyboardConnected(), and IsMouseConnected().

Referenced by CGame::UpdateInputDeviceDisconnectWarning().

◆ ChangeGameFocus()

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

Change game focus number.

Parameters
addnumber to add to focus number
input_deviceif equals -1, works globally on all devices, see INPUT_DEVICE_* values in constants.h
See also
HasGameFocus()

◆ DisableKey()

proto native void DisableKey ( int key)
private

Disable key until end of frame.

Parameters
keyid of key, defined in KeyCode
g_Game.GetInput().DisableKey(KeyCode.KC_RETURN);
DayZGame g_Game
Definition dayzgame.c:3942
KeyCode
Definition ensystem.c:157

Referenced by MissionBase::OnUpdate().

◆ EnableGamepad()

proto native void EnableGamepad ( bool enable)
private

Enable gamepad (on PC).

◆ EnableMouseAndKeyboard()

proto native void EnableMouseAndKeyboard ( bool enable)
private

Enable mouse and keyboard (on consoles).

◆ FillUnavailableDeviceArray()

void FillUnavailableDeviceArray ( int device,
inout array< int > filler )
inlineprivate

Definition at line 226 of file input.c.

Referenced by 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
Returns
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

Referenced by ScriptedWidgetEventHandler::InitPresets(), and UIScriptedMenu::InitPresets().

◆ GetCurrentProfileActionKeys()

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

◆ GetDeviceName()

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

References name.

◆ GetDevicesCount()

proto native int GetDevicesCount ( )
private

◆ GetEnterButton()

proto native GamepadButton GetEnterButton ( )
private
Note
For PlayStation, Enter button in Asia territory is typically Circle button (B button), but in Europe and America it is Cross button (A button).
Returns
Button, which represent Enter/Accept button.

◆ GetGamepadList()

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

Referenced by GetUserGamepad().

◆ GetGamepadThumbDirection()

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

return true if was deflected button.

Referenced by UpdataControllerInput().

◆ 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

References name.

Referenced by ScriptedWidgetEventHandler::InitPresets(), and UIScriptedMenu::InitPresets().

◆ GetProfilesCount()

proto native int GetProfilesCount ( )
private

◆ GetUserGamepad()

int GetUserGamepad ( BiosUser user)
inlineprivate

Definition at line 338 of file input.c.

References GetGamepadList(), and GetGamepadUser().

Referenced by CGame::GamepadCheck().

◆ HasGameFocus()

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

Check if game should have focus.

Parameters
input_deviceif equals -1, checks all devices, see INPUT_DEVICE_* values in constants.h
Returns
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

Parameters
buttonthe button that needs to be pressed for the identification

Referenced by CGame::GamepadCheck().

◆ IsActiveGamepadSelected()

proto native bool IsActiveGamepadSelected ( )
private

◆ IsAnyInputDeviceActive()

bool IsAnyInputDeviceActive ( )
inlineprivate

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

Definition at line 164 of file input.c.

References IsActiveGamepadSelected(), IsKeyboardConnected(), and IsMouseConnected().

◆ IsDeviceEnabled()

proto native int IsDeviceEnabled ( int device_index)
private

◆ IsDeviceXInput()

proto native int IsDeviceXInput ( int device_index)
private

◆ IsEnabledGamepad()

proto native bool IsEnabledGamepad ( )
private
Returns
state of support gamepad (on PC)

◆ IsEnabledMouseAndKeyboard()

proto native bool IsEnabledMouseAndKeyboard ( )
private
Returns
state of support mouse and keyboard (on consoles)

Referenced by AreAllAllowedInputDevicesActive().

◆ IsEnabledMouseAndKeyboardEvenOnServer()

proto native bool IsEnabledMouseAndKeyboardEvenOnServer ( )
private
Returns
state of support mouse and keyboard. If client playing on server where mouse and keyboard is disabled, then return false. (on consoles)

Referenced by AreAllAllowedInputDevicesActive(), MissionBase::OnUpdate(), and RadialMenu().

◆ IsInactiveGamepadOrUserSelected()

bool IsInactiveGamepadOrUserSelected ( int gamepad = -1)
inlineprivate

Definition at line 352 of file input.c.

References g_Game, GetGamepadUser(), and IsActiveGamepadSelected().

Referenced by OnGamepadDisconnected().

◆ IsKeyboardConnected()

proto native bool IsKeyboardConnected ( )
private

◆ IsMouseConnected()

proto native bool IsMouseConnected ( )
private
Returns
Console: Last state queried from the platform operating system for the active gamepad. PC: Always true.

Referenced by AreAllAllowedInputDevicesActive(), CGame::CanDisplayMouseCursor(), IsAnyInputDeviceActive(), and 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).

Parameters
actionid of action, defined in 4_World/Classes/UserActionsComponent/_constants.c
check_focusif true and game is unfocused, returns 0; otherwise returns actual value
Returns
true if action was released in that frame, false otherwise
See also
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).

Parameters
actionid of action, defined in 4_World/Classes/UserActionsComponent/_constants.c
check_focusif true and game is unfocused, returns 0; otherwise returns actual value
Returns
true if action was released in that frame, false otherwise
See also
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).

Note
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)
Parameters
actionid of action, defined in 4_World/Classes/UserActionsComponent/_constants.c
check_focusif true and game is unfocused, returns 0; otherwise returns actual value
Returns
true if action was invoked in that frame, false otherwise
See also
LocalPress()

Referenced by HandleInput().

◆ 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).

Parameters
actionid of action, defined in 4_World/Classes/UserActionsComponent/_constants.c
check_focusif true and game is unfocused, returns 0; otherwise returns actual value
Returns
true if action was released in that frame, false otherwise
See also
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.

Parameters
actionid of action, defined in 4_World/Classes/UserActionsComponent/_constants.c
check_focusif true and game is unfocused, returns 0; otherwise returns actual value
Returns
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
See also
LocalValue()

◆ OnGamepadConnected()

void OnGamepadConnected ( int gamepad)
inlineprivate

callback that is fired when a new gamepad is connected

Definition at line 261 of file input.c.

References g_Game, GetGamepadUser(), mission, and SelectActiveGamepad().

◆ OnGamepadDisconnected()

void OnGamepadDisconnected ( int gamepad)
inlineprivate

callback that is fired when gamepad is disconnected

Definition at line 290 of file input.c.

References g_Game, IsInactiveGamepadOrUserSelected(), mission, and UpdateConnectedInputDeviceList().

◆ OnGamepadIdentification()

void OnGamepadIdentification ( int gamepad)
inlineprivate

callback that is fired when identification was requested

Definition at line 313 of file input.c.

References g_Game, mission, SelectActiveGamepad(), and 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

Definition at line 410 of file input.c.

References g_Game, and 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

Definition at line 428 of file input.c.

References g_Game, and UpdateConnectedInputDeviceList().

◆ OnLastInputDeviceChanged()

void OnLastInputDeviceChanged ( EInputDeviceType inputDevice)
inlineprivate

called from code on different input device use

Definition at line 445 of file input.c.

References g_Game.

◆ 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

Definition at line 374 of file input.c.

References g_Game, and 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

Definition at line 392 of file input.c.

References g_Game, and UpdateConnectedInputDeviceList().

◆ ResetActiveGamepad()

proto native void ResetActiveGamepad ( )
private

clears active gamepad

Referenced by CGame::SelectUser().

◆ ResetGameFocus()

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

Reset game focus number (set to 0).

Parameters
input_deviceif equals -1, works globally on all devices, see INPUT_DEVICE_* values in constants.h
See also
HasGameFocus()

◆ SelectActiveGamepad()

proto native void SelectActiveGamepad ( int gamepad)
private

◆ 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.

Definition at line 235 of file input.c.

References g_Game, IsActiveGamepadSelected(), IsKeyboardConnected(), and IsMouseConnected().

Referenced by CGame::DeferredInit(), OnGamepadDisconnected(), OnGamepadIdentification(), OnKeyboardConnected(), OnKeyboardDisconnected(), OnMouseConnected(), and OnMouseDisconnected().


The documentation for this class was generated from the following file:
  • F:/Games/Dayz/scripts/3_game/tools/input.c