|
Enfusion Script API
|
Manages input key bindings, presets, contexts, and device calibration. More...
Public Member Functions | |
| proto external void | Save () |
| Saves all current bindings and settings to persistent storage. | |
| proto external void | ResetDefault (string actionName, EInputDeviceType deviceType=EInputDeviceType.INVALID, string preset=string.Empty) |
| Resets the binding for the specified action to its default value. | |
| proto external bool | IsDefault (string actionName, EInputDeviceType deviceType=EInputDeviceType.KEYBOARD, string preset=string.Empty) |
| Checks if the binding for an action is currently set to its default value. | |
| proto external bool | CreateUserBinding (string actionName, EInputDeviceType deviceType=EInputDeviceType.KEYBOARD, string preset=string.Empty) |
| Creates a new user-defined binding for the given action. | |
| proto external int | GetBindingsCount (string actionName, EInputDeviceType deviceType=EInputDeviceType.KEYBOARD, string preset=string.Empty) |
| Gets the number of bindings for the given action and device type. | |
| proto external void | RemoveBinding (string actionName, EInputDeviceType deviceType, string preset, int keyBindIndex) |
| Removes a specific binding by its index for the given action, device, and preset. | |
| proto external void | AddBinding (string actionName, string preset, string keyBinding, string filterName=string.Empty) |
| Adds a new binding for the specified action and preset. | |
| proto external void | InsertCombo (string actionName, string preset, string keyBinding, string filterName, int keyBindIndex, int comboIndex=-1) |
| Inserts a key combination into the binding list. | |
| proto external bool | SetFilter (string actionName, EInputDeviceType deviceType, string preset, int keyBindIndex, string filterName) |
| Sets the filter for a user binding. | |
| proto external string | GetFilter (string actionName, EInputDeviceType deviceType, string preset, int keyBindIndex) |
| Gets the filter name for the specified binding. | |
| proto external void | StartCapture (string actionName, EInputDeviceType deviceType=EInputDeviceType.KEYBOARD, string preset=string.Empty, bool bAppend=false, EInputBindingAxleCapture eAxleCapture=EInputBindingAxleCapture.HALF_AXLE) |
| Starts capturing user input for binding purposes. | |
| proto external void | CancelCapture () |
| Cancels the current binding capture process. | |
| proto external void | SaveCapture (array< string > additionalKeyBindings=null) |
| Immediately finish running input capture and save results. | |
| proto external EInputBindingCaptureState | GetCaptureState () |
| Returns the current state of an active binding capture operation. | |
| proto external void | GetCustomConfigs (out notnull array< ResourceName > customConfigs) |
| Retrieves the custom binding configurations. | |
| proto external void | SetCustomConfigs (notnull array< ResourceName > customConfigs) |
| Sets custom configuration for key bindings. | |
| proto external BaseContainer | FindContext (string contextName) |
| Finds and returns the container for the specified context. | |
| proto external BaseContainer | FindAction (string actionName) |
| Finds and returns the container for the specified action. | |
| proto external void | StartCalibration (EInputDeviceType deviceType) |
| Starts calibration process for the specified input device type. | |
| proto external void | StopCalibration () |
| Stops any running calibration process. | |
| proto external EInputBindingCalibrationStatus | GetCalibrationStatus () |
| Gets the current status of the calibration process. | |
| proto external bool | GetCalibrationData (EInputBindingCalibrationData dataType, out vector min, out vector max) |
| Gets the min and max calibration values for the given data type. | |
| proto external bool | GetConflicts (string actionName, out notnull array< int > keyBindIndices, out notnull array< string > conflictedActions, out notnull array< string > conflictedActionPresets, EInputDeviceType deviceType=EInputDeviceType.KEYBOARD, string preset=string.Empty) |
| Checks for key binding conflicts for a given action. | |
| proto external bool | GetBindings (string actionName, out notnull array< string > bindings, EInputDeviceType deviceType=EInputDeviceType.KEYBOARD, string sPreset=string.Empty, bool uiInputNames=true) |
| Retrieves input bindings for a specified action and device type. | |
| proto external void | GetContexts (out array< string > contextNames) |
| Retrieves all available input contexts. | |
| proto external void | GetPresets (string actionName, out array< string > presetNames) |
| Gets all preset names for a given action. | |
| proto external KeyCode | GetKeyCode (string inputName) |
| Resolves an input name to its corresponding key code. | |
Manages input key bindings, presets, contexts, and device calibration.
Provides functions for creating, resetting, querying, modifying, and calibrating input bindings for various device types and action presets.
| proto external void InputBinding.AddBinding | ( | string | actionName, |
| string | preset, | ||
| string | keyBinding, | ||
| string | filterName = string.Empty ) |
Adds a new binding for the specified action and preset.
| actionName | Name of the action. |
| preset | Name of the preset. |
| keyBinding | Keybinding string to add. |
| filterName | (Optional) Filter name to use. Defaults to empty string. |
| proto external void InputBinding.CancelCapture | ( | ) |
Cancels the current binding capture process.
| proto external bool InputBinding.CreateUserBinding | ( | string | actionName, |
| EInputDeviceType | deviceType = EInputDeviceType.KEYBOARD, | ||
| string | preset = string.Empty ) |
Creates a new user-defined binding for the given action.
| actionName | Name of the action. |
| deviceType | (Optional) Device type. Defaults to KEYBOARD. |
| preset | (Optional) Preset name. Defaults to empty string. |
| proto external BaseContainer InputBinding.FindAction | ( | string | actionName | ) |
Finds and returns the container for the specified action.
| actionName | Name of the action to search for. |
| proto external BaseContainer InputBinding.FindContext | ( | string | contextName | ) |
Finds and returns the container for the specified context.
| contextName | Name of the context to search for. |
| proto external bool InputBinding.GetBindings | ( | string | actionName, |
| out notnull array< string > | bindings, | ||
| EInputDeviceType | deviceType = EInputDeviceType.KEYBOARD, | ||
| string | sPreset = string.Empty, | ||
| bool | uiInputNames = true ) |
Retrieves input bindings for a specified action and device type.
Finds and collects input bindings matching the given action name, device type, and optional preset.
| actionName | Name of the input action. |
| bindings | Array to store found binding strings. |
| deviceType | Enum specifying the source device type. |
| sPreset | Name of the binding preset to use. |
| uiInputNames | (Optional) Whether to use user-friendly names. Defaults to true. |
| proto external int InputBinding.GetBindingsCount | ( | string | actionName, |
| EInputDeviceType | deviceType = EInputDeviceType.KEYBOARD, | ||
| string | preset = string.Empty ) |
Gets the number of bindings for the given action and device type.
| actionName | Name of the action. |
| deviceType | (Optional) Device type. Defaults to KEYBOARD. |
| preset | (Optional) Preset name. Defaults to empty string. |
| proto external bool InputBinding.GetCalibrationData | ( | EInputBindingCalibrationData | dataType, |
| out vector | min, | ||
| out vector | max ) |
Gets the min and max calibration values for the given data type.
| dataType | Calibration data type. | |
| [out] | min | Output vector for minimum calibration. |
| [out] | max | Output vector for maximum calibration. |
| proto external EInputBindingCalibrationStatus InputBinding.GetCalibrationStatus | ( | ) |
Gets the current status of the calibration process.
| proto external EInputBindingCaptureState InputBinding.GetCaptureState | ( | ) |
Returns the current state of an active binding capture operation.
| proto external bool InputBinding.GetConflicts | ( | string | actionName, |
| out notnull array< int > | keyBindIndices, | ||
| out notnull array< string > | conflictedActions, | ||
| out notnull array< string > | conflictedActionPresets, | ||
| EInputDeviceType | deviceType = EInputDeviceType.KEYBOARD, | ||
| string | preset = string.Empty ) |
Checks for key binding conflicts for a given action.
Identifies if the specified action's key bindings conflict with other actions on the given input device type and preset.
| actionName | Name of the action to check. | |
| [out] | keyBindIndices | Output array of indices of the conflicting key bindings. |
| [out] | conflictedActions | Output array of conflicted action names. |
| [out] | conflictedActionPresets | Output array of conflicted action presets. |
| deviceType | (Optional) Input device type to check. Defaults to KEYBOARD. | |
| preset | (Optional) Name of the preset to check. Defaults to empty string. |
| proto external void InputBinding.GetContexts | ( | out array< string > | contextNames | ) |
Retrieves all available input contexts.
Populates an array with the names of all defined input contexts.
| [out] | contextNames | Output array to be populated with context names. |
| proto external void InputBinding.GetCustomConfigs | ( | out notnull array< ResourceName > | customConfigs | ) |
Retrieves the custom binding configurations.
| [out] | customConfigs | Output array for custom configs. |
| proto external string InputBinding.GetFilter | ( | string | actionName, |
| EInputDeviceType | deviceType, | ||
| string | preset, | ||
| int | keyBindIndex ) |
Gets the filter name for the specified binding.
| actionName | Name of the action. |
| deviceType | Device type. |
| preset | Preset name. |
| keyBindIndex | Index of the binding. |
Gets all preset names for a given action.
Fills an array with the names of all presets in given action.
| actionName | Name of the input action. | |
| [out] | presetNames | Output array to hold the preset names. |
| proto external void InputBinding.InsertCombo | ( | string | actionName, |
| string | preset, | ||
| string | keyBinding, | ||
| string | filterName, | ||
| int | keyBindIndex, | ||
| int | comboIndex = -1 ) |
Inserts a key combination into the binding list.
| actionName | Name of the action. |
| preset | Preset name. |
| keyBinding | Keybinding string to insert. |
| filterName | Name of the filter. |
| keyBindIndex | Index of the binding to modify. |
| comboIndex | (Optional) Index to insert the combo. Defaults to -1 (append). |
| proto external bool InputBinding.IsDefault | ( | string | actionName, |
| EInputDeviceType | deviceType = EInputDeviceType.KEYBOARD, | ||
| string | preset = string.Empty ) |
Checks if the binding for an action is currently set to its default value.
| actionName | Action name to check. |
| deviceType | (Optional) Input device type. Defaults to KEYBOARD. |
| preset | (Optional) Preset name. Defaults to empty string. |
| proto external void InputBinding.RemoveBinding | ( | string | actionName, |
| EInputDeviceType | deviceType, | ||
| string | preset, | ||
| int | keyBindIndex ) |
Removes a specific binding by its index for the given action, device, and preset.
| actionName | Target action name. |
| deviceType | Target device type. |
| preset | Target preset. |
| keyBindIndex | Index of the binding to be removed. |
| proto external void InputBinding.ResetDefault | ( | string | actionName, |
| EInputDeviceType | deviceType = EInputDeviceType.INVALID, | ||
| string | preset = string.Empty ) |
Resets the binding for the specified action to its default value.
| actionName | Action name to reset. |
| deviceType | (Optional) Input device type. Defaults to INVALID. |
| preset | (Optional) Preset name. Defaults to empty string. |
| proto external void InputBinding.Save | ( | ) |
Saves all current bindings and settings to persistent storage.
| proto external void InputBinding.SaveCapture | ( | array< string > | additionalKeyBindings = null | ) |
Immediately finish running input capture and save results.
Additional key bindings can be added using additionalKeyBindings array.
| additionalKeyBindings | (Optional) Array of additional key bindings to save. |
| proto external void InputBinding.SetCustomConfigs | ( | notnull array< ResourceName > | customConfigs | ) |
Sets custom configuration for key bindings.
| customConfigs | Input array of custom configs. |
| proto external bool InputBinding.SetFilter | ( | string | actionName, |
| EInputDeviceType | deviceType, | ||
| string | preset, | ||
| int | keyBindIndex, | ||
| string | filterName ) |
Sets the filter for a user binding.
| actionName | Name of the action. |
| deviceType | Device type. |
| preset | Preset name. |
| keyBindIndex | Index of the binding. |
| filterName | Name of the filter to assign. |
| proto external void InputBinding.StartCalibration | ( | EInputDeviceType | deviceType | ) |
Starts calibration process for the specified input device type.
| deviceType | Device type to calibrate. |
| proto external void InputBinding.StartCapture | ( | string | actionName, |
| EInputDeviceType | deviceType = EInputDeviceType.KEYBOARD, | ||
| string | preset = string.Empty, | ||
| bool | bAppend = false, | ||
| EInputBindingAxleCapture | eAxleCapture = EInputBindingAxleCapture.HALF_AXLE ) |
Starts capturing user input for binding purposes.
After calling this method, InputBinding is listening for activated inputs. After input are pressed, capturing ends and state is returned back to EInputBindingCaptureState.IDLE
| actionName | Name of the action. |
| deviceType | (Optional) Device type. Defaults to KEYBOARD. |
| preset | (Optional) Preset name. Defaults to empty string. |
| bAppend | (Optional) If true, appends new binding. Defaults to false. |
| eAxleCapture | (Optional) Method for capturing axes. Defaults to HALF_AXLE. |
| proto external void InputBinding.StopCalibration | ( | ) |
Stops any running calibration process.