This Exiled plugin allows other plugins to customize the player's key binding.
- Add -allow-syncbind in the launch option
- Use the command "synccmd" twice in the client console until "SyncServerCommandBinding has been enabled" appears on the console.
- Enable enable_sync_command_binding option in config_gameplay.txt
- Put KeyBindingServiceMeow.dll under Plugins folder
- Put Newtonsoft.Json.dll under Plugins.dependencies folder
Here's a simple instruction to develop using this plugin:
There 2 major way to bind a key to your action:
Method | Advantage | Disadvantage |
---|---|---|
HotKey | Player can know which key the plugin is using and customize it using command | You have to create a HotKey instance and register it for every single player |
Event | Easy to use. | It is not customizable and not visible for players |
- Hot Key
var hotKey = new HotKey(KeyCode.YourKeyCode, "ID", "Name", "Descriptoin(optional)", "Category(optional)");
hotKey.KeyPressed += YourMethod;
API.Features.HotKey.HotKeyBinder.RegisterKey(ev.Player, hotKeys);
- Event
API.Event.Events.RegisterKeyToEvent(KeyCode.YourKeyCode);
API.Event.Events.KeyPressed += OnKeyPressed;
When using OnKeyPressed event, you must first register your key using RegisterKeyToEvent method.