BULLETBOT-KeybindLib icon

KeybindLib

A library that lets you add your own keybinds to the controls.

Last updated 2 days ago
Total downloads 32881
Total rating 0 
Categories Libraries
Dependency string BULLETBOT-KeybindLib-1.0.0
Dependants 6 other packages depend on this package

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.