Is there a way to set a default keybind for a newly created PluginAction through script?
The documentation sample shows how to create the PluginAction, but not how to assign it a default keybind.
local plugin = plugin or getfenv().PluginManager():CreatePlugin()
plugin.Name = "Plugin"
local function actionTriggered()
print("Hello world!")
end
local pluginAction = plugin:CreatePluginAction("HelloWorldAction", "Hello World", "Prints a 'Hello world!'", "bxasset://textures/sparkle.png", true)
pluginAction.Triggered:Connect(actionTriggered)
No, it is not possible. PluginActions cannot be used until the user manually goes in and sets a keybinds for every action their plugin creates (or, at least the ones they care about). Plugins would need to open a prompt like “The following actions have been added to customize shortcuts. You will need to register bindings in order to use them”.
Do you know if there is a feature request to open this up? Seems really silly to me that they don’t allow this.
I understand the concerns, like having a plugin that overrides a default keybinding of some other feature, but those types of conflicts should be pretty easy to solve if the shortcuts menu gets some love.