SubscribeToOnInput

Tracking Issue: #198

Tags: ui

Mods may want to intercept mouse/keyboard/controller input and instead run their own code. For most purposes, this feature should be considered superseded by SubscribeToOnInputForScreen, which is more ergonomic to use and harder to misuse. Read that documentation page for a general overview.

This feature does not allow receiving the notification only for a specific screen, which is usually what you want. Additionally, it is required to manually unsubscribe at some point, lest you invoke the wrath of the garbage collector and crash everyone's games.

delegate bool CHOnInputDelegate(int iInput, int ActionMask);
function SubscribeToOnInput(delegate<CHOnInputDelegate> callback);
function UnsubscribeFromOnInput(delegate<CHOnInputDelegate> callback);

Again, it is recommended to instead use SubscribeToOnInputForScreen. The documentation for that feature has examples.

Source code references