DIFF

class InputSource

Methods 58

proto native void ResetGameFocus(int input_device = -1)

Reset game focus number (set to 0)

input_device
if equals -1, works globally on all devices, see INPUT_DEVICE_* values in constants.h

See also: HasGameFocus()

proto native bool HasGameFocus(int input_device = -1)

Check if game should have focus

input_device
if equals -1, checks all devices, see INPUT_DEVICE_* values in constants.h

Returns: true if focus number == 0, false otherwise

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

action
id of action, defined in \ref 4_World/Classes/UserActionsComponent/_constants.c
check_focus
if 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()

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)

action
id of action, defined in \ref 4_World/Classes/UserActionsComponent/_constants.c
check_focus
if true and game is unfocused, returns 0; otherwise returns actual value

Returns: true if action was invoked in that frame, false otherwise

Noteif 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)

See also: LocalPress()

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)

action
id of action, defined in \ref 4_World/Classes/UserActionsComponent/_constants.c
check_focus
if 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()

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)

action
id of action, defined in \ref 4_World/Classes/UserActionsComponent/_constants.c
check_focus
if 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()

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)

action
id of action, defined in \ref 4_World/Classes/UserActionsComponent/_constants.c
check_focus
if 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()

proto native bool LocalDbl(string action, bool check_focus = true)
proto native void DisableKey(int key)

Disable key until end of frame

key
id of key, defined in \ref KeyCode
g_Game.GetInput().DisableKey(KeyCode.KC_RETURN);
proto native void EnableMouseAndKeyboard(bool enable)

Enable mouse and keyboard (on consoles)

proto native void EnableGamepad(bool enable)

Enable gamepad (on PC)

proto native bool IsEnabledGamepad()

Returns: state of support gamepad (on PC)

proto native bool IsEnabledMouseAndKeyboardEvenOnServer()

Returns: state of support mouse and keyboard. If client playing on server where mouse and keyboard is disabled, then return false. (on consoles)

proto native bool IsMouseConnected()

Returns: Console: Last state queried from the platform operating system for the active gamepad. PC: Always true.

proto native int GetCurrentProfile()

gets currently selected profile

proto native void GetCurrentProfileActionKeys(int action_index, out TIntArray keys)
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)
Referenced by GetUserGamepad()
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

button
the button that needs to be pressed for the identification
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.

unavailableDeviceList
lists all devices that SHOULD be available, but aren't. Optional.
void FillUnavailableDeviceArray(int device, inout array<int> filler)
References array.Insert()
proto native EInputDeviceType GetCurrentInputDevice()

Returns: Input device, with the last input event ('mouse and keyboard', 'controller' or 'unknown' if none input event was fired from the beginning).

Referenced by ActionTargetsCursor.UpdatePCIconsVisibility(), CharacterCreationMenu.OnShow(), CharacterCreationMenu.UpdateControlsElementVisibility()
Show 38 more, ConnectionDialogue.Init(), ConnectionDialogue.UpdateControlsElementVisibility(), ControlsXboxNew.OnShow(), ControlsXboxNew.UpdateControlsElementVisibility(), CreditsMenu.Init(), GesturesMenu.UpdateControlsElements(), InGameMenuXbox.OnShow(), InGameMenuXbox.UpdateControlsElements(), Inventory.UpdateConsoleToolbar(), Inventory.UpdateInterval(), InviteMenu.Init(), InviteMenu.UpdateControlsElementVisibility(), ItemActionsWidget.UpdatePCIconsVisibility(), LoginQueueBase.Init(), LoginTimeBase.Init(), LogoutMenu.Init(), LogoutMenu.UpdateControlsElementVisibility(), MainMenuConsole.Init(), MainMenuConsole.OnShow(), MainMenuConsole.UpdateControlsElementVisibility(), MainMenuDlcHandlerBase.UpdateIconVisibility(), MainMenuVideo.UpdateControlsElements(), MapMenu.UpdateControlsElementVisibility(), NewsCarousel.NewsCarousel(), OptionsMenu.Refresh(), OptionsMenu.UpdateControlsElementVisibility(), PasswordMenuToolbarHandler.UpdateControlsElements(), RadialQuickbarMenu.UpdateControlsElements(), ServerBrowserMenuNew.OnShow(), ServerBrowserTabConsolePages.Construct(), TabberUI.Init(), TutorialKeybinds.GetActiveDeviceFlags(), TutorialsMenu.GetControlMappingInfo(), TutorialsMenu.OnShow(), TutorialsMenu.UpdateControlsElementVisibility(), VicinitySlotsContainer.TransferItem(), WarningMenuBase.Init(), and WarningMenuBase.UpdateControlsElementVisibility()
proto native GamepadButton GetEnterButton()

Returns: Button, which represent Enter/Accept button.

NoteFor PlayStation, Enter button in Asia territory is typically Circle button (B button), but in Europe and America it is Cross button (A button).
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

bool IsInactiveGamepadOrUserSelected(int gamepad = -1)
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

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