Script v1_7_1_0
- AI
- Animals
- Collections
- Contracts
- Debug
- Economy
- Elements
- EnvironmentalScore
- Errors
- Events
- GUI
- Handtools
- Hud
- I3d
- Input
- Jobs
- Maps
- Materials
- Misc
- Objects
- Parameters
- Placeables
- Placement
- Player
- Shop
- Sounds
- Specialization
- Specializations
- StateMachine
- Statistics
- Tasks
- Triggers
- Utils
- Vehicles
Engine v1_7_1_0
- AI
- Animation
- Camera
- Entity
- Fillplanes
- general
- General
- I3D
- Input
- Lighting
- Math
- Network
- Node
- NoteNode
- Overlays
- Particle System
- Physics
- Rendering
- Scenegraph
- Shape
- Sound
- Spline
- String
- Terrain Detail
- Text Rendering
- Tire Track
- VoiceChat
- XML
Foundation Reference
InputBinding
DescriptionInput binding manager. Loads and saves action input bindings and provides action trigger information. Methods of note (see the documentation of the actual methods for more detailed descriptions): registerActionEvent() Register an event callback for an action (for action values, see InputAction.lua) removeActionEvent() Removes a previously registered event. Also see removeActionEventsByTarget(). setActionEvent...() Group of methods to adjust event states, e.g. activity or input display hint parameters. Input event usage scenarios: 1. Long lifetime components / much interaction: Register event at creation of a component, modify event in component update method depending on its state, remove event at component destruction 2. Short lifetime components / little interaction: Register event when necessary (e.g. when in range of an object), remove again when no interaction is possible anymore Player input settings are loaded from the file "inputBindings.xml" in their profile directory. If the file is not present or corrupted whenever input is loaded, it will be restored from a suitable template. If a binding of a locked action is changed directly on the file system, it will be overwritten with its template counterpart on the next loading call to ensure that critical inputs are always available (e.g. menu navigation).Functions
setContextEventsActive
DescriptionGet a menu action event IDs by its name. Modify GUI action events with care, as they are globally defined for an entire session.Definition
setContextEventsActive()Code
3922 | function InputBinding:setContextEventsActive(contextName, actionName, isActive) |
3923 | local context = self.contexts[contextName] or {} |
3924 | local action = self.nameActions[actionName] |
3925 | local actionEvents = context.actionEvents[action] |
3926 | |
3927 | for _, event in ipairs(actionEvents) do |
3928 | self:setEventActive(event, isActive) |
3929 | end |
3930 | end |