Hi all, I would like to use a more reasonable redo hotkey in Unity that matches all other applications I use, as well as a hotkey my hand can more comfortably reach. It appears there isn’t some way to actually do this?
Is there some hack or anything I can do to not have to relearn a new muscle memory and stretch way out for an action that should be easy to do? Frankly, the fact that I can’t remap all my hotkeys, but only some, in Unity is fairly distressing to me in the first place.
Hi, @sand_lantern! I know this post is old and I’m not sure if you already resolved this issue, but I found a solution and wanted to help those who may have this same problem (including me).
To add hotkeys in Unity (at least for version 2017.1.1f1), you need to create a C# script, add the UnityEditor namespace at the top of the script, create a MenuItem with the name of the action and its relative hotkey (optional), and create a function of the actions that you want performed for your new hotkey.
For example, I created a short script to add an additional hotkey to redo actions in Unity (Note: I use Microsoft Visual Studio instead of MonoDevelop):
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor; // 1) Add UnityEditor namespace
/// <summary>
/// Adds hotkeys to Unity Editor
/// </summary>
public class ExtendedHotkeys : ScriptableObject
{
/// <summary>
/// Redo with SHIFT+CTRL+Z
/// </summary>
[MenuItem("Edit/Redo #%z")] // 2) Create MenuItem with its menu location, name, and hotkey (optional)
static void Redo() // 3) Create the function to execute when performing the hotkey
{
Undo.PerformRedo();
}
}
Copy and paste the code into a C# script in Unity (preferrably named ExtendedHotkeys) and save it in Assets/Editor. Then check the Edit tab in Unity to see if you now have a new action called Redo at the bottom of the menu and if its hotkey is SHIFT+CTRL+Z. Now you can press SHIFT+CTRL+Z (or whatever hotkey you decide to change it to) to redo!
Here is the Unity Scripting API 1 referring to the MenuItem class. I hope this was helpful.