Visit its Steam Workshop page and subscribe!
Add improved-input-config
as a requirement in modinfo.json
, then reference the latest release. Make sure to keep the ImprovedInput.xml
file next to the ImprovedInput.dll
file.
Registering a keybind boils down to something like this in your mod's plugin class:
public static readonly PlayerKeybind Explode = PlayerKeybind.Register("example:explode", "Example Mod", "Explode", KeyCode.C, KeyCode.JoystickButton3);
If that doesn't work...
...assign the keybind in your OnEnable()
method inside a try-catch block to make sure there's no issues.
public static PlayerKeybind Explode;
void OnEnable() {
try {
Explode = PlayerKeybind.Register("example:explode", "Example Mod", "Explode", KeyCode.C, KeyCode.JoystickButton3);
}
catch (Exception e) {
Logger.LogError(e);
}
}