Plugin set Keybind for CreatePluginAction

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.

https://developer.roblox.com/en-us/api-reference/function/Plugin/CreatePluginAction

https://developer.roblox.com/en-us/api-reference/class/PluginAction

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)
1 Like

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”.

Right now they’re not very feasible to use

2 Likes

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.

1 Like

Yeah, there’s a feature request for this. Kind of a shame it didn’t go anywhere. PluginAction.AssignedShortcut and 4th CreatePluginAction() parameter

3 Likes