PC Stable Documentation
 
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Loading...
Searching...
No Matches
Input Class Reference

Private Member Functions

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 void EnableGamepad (bool enable)
 Enable gamepad (on PC)
 
proto native bool IsEnabledGamepad ()
 
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
 

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.

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

◆ DisableKey()

proto native void DisableKey ( int  key)
private

Disable key until end of frame.

Parameters
keyid of key, defined in KeyCode
proto native Input GetInput()
proto native void DisableKey(int key)
Disable key until end of frame.
proto native CGame GetGame()
KeyCode
Definition EnSystem.c:157

Referenced by MissionBase::OnUpdate().

◆ EnableGamepad()

proto native void EnableGamepad ( bool  enable)
private

Enable gamepad (on PC)

Referenced by UIScriptedMenu::Init(), and UIScriptedMenu::~ServerBrowserMenuNew().

◆ EnableMouseAndKeyboard()

proto native void EnableMouseAndKeyboard ( bool  enable)
private

Enable mouse and keyboard (on consoles)

◆ FillUnavailableDeviceArray()

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

◆ 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

◆ GetCurrentProfile()

proto native int GetCurrentProfile ( )
private

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

◆ GetProfilesCount()

proto native int GetProfilesCount ( )
private

◆ GetUserGamepad()

int GetUserGamepad ( BiosUser  user)
inlineprivate

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(), BiosUserManager::OnJoin(), and CGame::SelectUser().

◆ IsActiveGamepadSelected()

proto native bool IsActiveGamepadSelected ( )
private

◆ IsAnyInputDeviceActive()

bool IsAnyInputDeviceActive ( )
inlineprivate

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

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

◆ IsEnabledMouseAndKeyboardEvenOnServer()

◆ IsInactiveGamepadOrUserSelected()

bool IsInactiveGamepadOrUserSelected ( int  gamepad = -1)
inlineprivate

◆ 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

◆ OnGamepadDisconnected()

void OnGamepadDisconnected ( int  gamepad)
inlineprivate

◆ OnGamepadIdentification()

void OnGamepadIdentification ( int  gamepad)
inlineprivate

◆ 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

References g_Game, GetGame(), CGame::GetMission(), Mission::GetOnInputDeviceConnected(), ScriptInvoker::Invoke(), 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

References g_Game, GetGame(), CGame::GetMission(), Mission::GetOnInputDeviceDisconnected(), ScriptInvoker::Invoke(), and UpdateConnectedInputDeviceList().

◆ OnLastInputDeviceChanged()

void OnLastInputDeviceChanged ( EInputDeviceType  inputDevice)
inlineprivate

called from code on different input device use

References g_Game, GetGame(), CGame::GetMission(), Mission::GetOnInputDeviceChanged(), and ScriptInvoker::Invoke().

◆ 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

References g_Game, GetGame(), CGame::GetMission(), Mission::GetOnInputDeviceConnected(), ScriptInvoker::Invoke(), 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

References g_Game, GetGame(), CGame::GetMission(), Mission::GetOnInputDeviceDisconnected(), ScriptInvoker::Invoke(), and UpdateConnectedInputDeviceList().

◆ ResetActiveGamepad()

proto native void ResetActiveGamepad ( )
private

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

Referenced by UIScriptedMenu::OnMouseButtonDown(), ReleaseFocus(), and PluginBase::ToggleFocus().

◆ 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

◆ UpdateConnectedInputDeviceList()

void UpdateConnectedInputDeviceList ( )
inlineprivate

The documentation for this class was generated from the following file: