Introducing Plugin Actions

With the new Plugin:CreatePluginAction function, your plugins can create actions.

These actions can be bound to keyboard shortcuts, or added to the Quick Access Toolbar, like any other action in Studio.

This provides our plugin developers with a more “correct” way to provide hotkey access to their plugins. Relying on the UserInputService to detect hotkeys might lead to collisions with other plugins (they may be trolling for same keys) or, worse, might collide with an existing “native” keyboard shortcut, in which case the key combo might be consumed before being passed through to UserInputService.

Details available on the Wiki:
https://wiki.roblox.com/index.php?title=API:Class/Plugin/CreatePluginAction

Enjoy!

53 Likes

This just made my day.
And my week.
And my month.
And my year.
Thank you so much.

9 Likes

Great! Would love to see right-click context menu integration at some point too (with a filter for which items to add entries for, e.g, add on BaseParts or LuaSourceContainers context menus for targeted plugin actions)

8 Likes

This is so awesome! I can see building plugins benefiting greatly from this.

1 Like

Correct me if I’m wrong, but a potential problem I see with this feature is that the keyboard shortcuts are always active, while plugins have a concept of activation and deactivation. A lot of plugins, like building plugins, probably wouldn’t want their shortcuts to be active unless the plugin is active, and might want to allow other plugins to make use of the same shortcuts when the plugin isn’t activated.

Using UserInputService for this sort of thing is still sort of less than ideal since then it will only pick up shortcuts when the 3D view is focused. Maybe a new property on PluginAction could solve this problem:

  • RequiresActivated - Keybind only works when the corresponding plugin is activated. Additionally, multiple actions with RequiresActivated could share the same shortcut if they are from different plugins. Only the activated plugin would receive the trigger event, or none if no plugins are activated.
4 Likes

Aside from sharing keybinds, is there a reason you can’t just check plugin:IsActivated() or plugin:IsActivatedWithExclusiveMouse() to check whether you should ignore the PluginAction event or not? If not, we might just be able to allow actions to return pass/sink.

1 Like

The biggest thing is the shared keybinds for me. I’m thinking about plugins that use keys like 1, 2, 3, etc. I use these keys in a few of my own plugins, so as it is right now I couldn’t convert all of them to use plugin actions.

2 Likes

i like this feature, but i have some complaints about the specific implementation

for one, there’s no way to group actions based on plugins. if the users of a plugin i make want bind or change hotkeys, they’re going to have to know the name of each action, search for it, and bind it themselves. this is less than ideal in a lot of cases, and it would be much better if actions in the Customize Shortcuts menu could be better organized to make it easier to access the actions of specific plugins.

i also think that it’s important developers be able to set certain default keybinds, i suggest going with a system similar to what evaera suggested:

with a system like this, plugin developers could still set default keybinds for their plugins while avoiding collisions with other plugins

4 Likes

Yeesss. I’m still on vacation but found wifi at a random restaurant. Excited to use this when I get back

1 Like

I love this :smiley:
All this new plugin stuff is great!

2 Likes

Awesome! :+1:

1 Like

No! Where is the update poem!

Okay. I guess I’ll do this one:

A plugin’s the same,
Alas the same, like the game,
but one thing has changed;

Over the blue mountains,
Seen from the Planet Mars,
Was the Newest Plugin Class,
With a new Input Function, just as many have asked.

(im not a poet)

5 Likes

Thanks very much for this enhancement! This was the very first problem I ran into when I started downloading plugins that use plugin guis – there’s no way to give them focus from the keyboard.
Unfortunately, I can’t speak as a developer yet, as I haven’t made a gui that would benefit much from keyboard hotkeys.

@WhoBloxedWho plz update script finder. :smiley:

I think grouping shortcuts in the shortcuts menu would be sweet. Good suggestion, @crossStarCross

3 Likes

Most shortcuts in the settings included an icon on the left to help identify the shortcut. Is this something that could be included in the creation of the plugin action?

1 Like

All good suggestions, thanks. Will be looking into them.

In the mean time, for grouping, you could prepend the name of your plugin to the title of every Action:

“MyPlugin: Foop the Foo”

Then users could see all actions for your plugin by filtering on “MyPlugin”.

2 Likes