Custom Shortcuts is a plugin initially released to UE5 to allow designers to make their own editor shortcuts by executing blueprint editor code.
- Clone plugin in your project's Plugins/ folder.
- Regenerate visual studio project.
- Build your project using Visual Studio or Rider.
- Enable the plugin in the Plugin tab
- Create a new EditorUtilityBlueprint
- Make it inherit from CustomShortcutObject class
- Open it. In the details panel you can change the Input Chords of the input, as well as the name and description of it.
(In this example, I will show how to make a shortcut that doubles the size of an actor)
- Override the OnShortcutExecuted event to implement the behaviour of your shortcut when executed.
(The transaction nodes are here to register our modifications in the Undo history, allowing the user to revert the changes https://docs.unrealengine.com/4.27/en-US/BlueprintAPI/Transactions/)
- (Optionnal) You can override the CanExecuteShortcut function to indicate wheter the shortcut can be executed or not
- Go in ProjectSettings > Plugins > Custom Shortcuts and add your class in the CustomShortcuts list
- If ever your shortcut is not well registered, you can use Tools > Refresh custom shortcuts. Restarting the engine should fix it too.
You shortcut is now registered in EditorSettings > Keyboard Shortcuts and can be executed by anyone!