Train plugin API (IRawRuntime)

This is the documentation for train plugins accepting raw input. In order to create a train plugin, implement the IRawRuntime interface from the OpenBveApi.Runtime namespace. In the following, you will find a description of how this interface works.

This interface is currently experimental / unstable, and subject to breaking changes.

■ Contenidos

■ Vista general

The IRawRuntime plugin interface is a separate interface, which extends the IRuntime interface to allow train plugins to accept raw keyboard / touch input from the simulation window.

This for instance may be useful if you wish to implement a plugin which accepts text input or large numbers of additional custom keys.

Please see the IRuntime interface documentation also.

■ Function Calls

void RawKeyDown(Key key)

This function is called when a key is pressed.

Arguments:

Key key The key that was pressed.

void RawKeyUp(Key key)

This function is called when a key is released.

Arguments:

Key key The key that was released.

void TouchEvent(int groupIndex, int commandIndex)

This function is called when a touch event occurs.

Arguments:

int groupIndex The touch group which was activated.
int commandIndex The associated command index for the touch group.

■ Additional ElapseData Members

IRawInput also adds the following useful ElapseData members:

Arguments:

BlockingInput boolean Whether the plugin is blocking input- This should be set when taking custom keyboard input to avoid triggering controls.