Controls container
From TrainzOnline
(Difference between revisions)
Line 4: | Line 4: | ||
The controls container is a list of control subcontainers with no standalone tags. Each control subcontainer uses the following format. | The controls container is a list of control subcontainers with no standalone tags. Each control subcontainer uses the following format. | ||
− | name-token | + | name-token "" |
− | desc-token | + | desc-token "" |
− | event | + | event "" |
− | default-keys | + | default-keys "" |
− | context | + | context "" |
− | reassignable | + | reassignable 1 |
− | trigger-on-up | + | trigger-on-up 0 |
− | trigger-on-down | + | trigger-on-down 1 |
− | trigger-on-held | + | trigger-on-held 1 |
+ | trigger-mode-analog 0 | ||
====name-token==== | ====name-token==== | ||
Line 51: | Line 52: | ||
:Type: bool | :Type: bool | ||
:Desc: Whether the control event should repeatedly trigger while a key remains held. | :Desc: Whether the control event should repeatedly trigger while a key remains held. | ||
+ | |||
+ | ====trigger-mode-analog==== | ||
+ | :Type: bool | ||
+ | :Desc: Sets the control as being for 'analog' use. For example, a throttle lever control, which has non-boolean input values. Requires a minimum trainz-build of 4.6. | ||
Revision as of 14:46, 22 November 2017
The controls container is a top-level config.txt file entry used by controlset assets.
Contents |
Supported Tags
The controls container is a list of control subcontainers with no standalone tags. Each control subcontainer uses the following format.
name-token "" desc-token "" event "" default-keys "" context "" reassignable 1 trigger-on-up 0 trigger-on-down 1 trigger-on-held 1 trigger-mode-analog 0
name-token
- Type: text
- Desc: The name of a string table entry with the user visible name of the control in it. This string table entry will be used in the Trainz user interface to refer to the control. It should be very short.
desc-token
- Type: text
- Desc: The name of a string table entry with the user visible description of the control in it. This string table entry will be used in the Trainz user interface to give detail to the user about the control. It should be fairly short. Optional.
event
- Type: text
- Desc: The name of the event to trigger when the control is triggered. A script message of the format ("ControlSet", <event>) will be posted to any linked library or interior asset (library/interior assets can specify a control set using the "controlset" tag). If the 'trigger-on-up' tag is set to true 'Message.minor' will be set to "<event>-up" when the key is released.
default-keys
- Type: text
- Desc: A comma separated list of the default keys to map to this control. Use "null" if no default keys are to be set, if multiple keys are required separate the keys with a space, e.g. "shift n".
- To note : default-keys are only available for built-in objects (source : Mr Windwalker himself !). For customized controlset, the hotkey should be defined via Start Trainz\Menu\Settings\Control Settings
context
- Type: text
- Desc: A semicolon separated list of contexts under which the control should be active, e.g. "surveyor;driver".
- Possible values: menu, surveyor, surveyor-topology, surveyor-paint, surveyor-objects, surveyor-track, surveyor-trains, surveyor-tools, surveyor-layers, driver, driver-cab, driver-cab-steam, driver-dcc, railyard
reassignable
- Type: bool
- Desc: Whether the control supports player reassignment in the options menus.
trigger-on-up
- Type: bool
- Desc: Whether the control event should trigger on key up.
trigger-on-down
- Type: bool
- Desc: Whether the control event should trigger on key down.
trigger-on-held
- Type: bool
- Desc: Whether the control event should repeatedly trigger while a key remains held.
trigger-mode-analog
- Type: bool
- Desc: Sets the control as being for 'analog' use. For example, a throttle lever control, which has non-boolean input values. Requires a minimum trainz-build of 4.6.
Example controls container
See controlset.