Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
You are viewing a potentially older version of this package.
View all versions.
| Date uploaded | 7 months ago |
| Version | 1.0.0 |
| Download link | BULLETBOT-KeybindLib-1.0.0.zip |
| Downloads | 59217 |
| Dependency string | BULLETBOT-KeybindLib-1.0.0 |
README
KeybindLib
- A library that lets you add your own keybinds.
Adding your own keybinds
Keybinds.Register(string name, string binding) => KeybindData
To register a keybind:
Keybinds.Register("Push", "<Keyboard>/b");
If you want to have toggle states:
KeybindData keybindData = Keybinds.Register("Push", "<Keyboard>/b");
if (keybindData != null)
{
keybindData.toggleData = new KeybindToggleData()
{
defaultValue = true,
falseText = "Off",
trueText = "On"
};
}
If you want to use the keybind:
SemiFunc.InputDown(keybindData.inputKey);
SemiFunc.InputUp(keybindData.inputKey);
SemiFunc.InputHold(keybindData.inputKey);
SemiFunc.InputToggleGet(keybindData.inputKey); // Only use this when you actually set the "toggleData" variable otherwise it will error.
There are much more variables in the "KeybindData" class. Check the class in dnSpy for more details.
CHANGELOG
Note
If that version is not listed here, do not download that version, as it can cause some issues.
1.0.6
- Fixed the mod.
1.0.5
- Added a public repository to the page for the developers.
1.0.4
- Fixed a possible crash when getting the calling mod.
1.0.3
- Removed unneccessary code such as debugging messages.
1.0.2
- Fixed a problem where the method couldn't find the calling mod.
1.0.1
- Added categories and mod/category based toggles.
- Updated the code structure.
1.0.0
- Initial release.