Search Issue Tracker
Postponed means that the issue was either a feature request or something that requires major refactoring on our side. Since that makes the issue not actionable in the close future we choose to close it as Postponed and add it on our internal roadmaps and technical debt pages instead.
Postponed
Votes
4
Found in
5.3.3p2
Issue ID
779917
Regression
No
Custom MenuItem hotkey takes priority over Input Field
Steps to reproduce:
1. Create new empty project
2. Create folder named "Editor"
3. In said folder create C# script named "MenuItems"
4. Paste this code to the script:
using UnityEngine;
using UnityEditor;
public static class MenuItems {
[MenuItem("Bug/Log to console _a")]
static void Bug()
{
Debug.Log("Hello World!");
}
}
5. Press "a" in editor and notice console output
6. Create Canvas->Input Field game object in scene
7. Play the scene and try to input letter "a" into the input field
Actual result: "Hello World" is output to console and nothing is written in Input Field
Expected result: Custom hotkeys get paused during play mode or there is an optional parameter to specify this behaviour
Tested and reproduced:
Windows 10
Unity 5.1.4f1, 5.2.4p1, 5.3.3p3, 5.4.0b10
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Articulation Body with 'Revolute' Joint Type has erratic behavior when Upper Limit is set to above 360
- WebGL Player fails to render Scene when Terrain with Detail Mesh is added and WebGPU Graphics API is used
- Inconsistent errors are logged when different types are passed into the Query "Q<>" method in UIToolkit and the ancestor VisualElement is null
- Crash on GetMaterialPropertyByIndex when opening a specific Scene
- Discrepancies in the styling are present when using a TSS file instead of a USS file in custom EditorWindow
xeosD
Apr 15, 2023 06:31
This "problem" exists as recently as 2021.3.x.
But in fact it's easy to work around by adding a validator clause before/after the menu time to only enable it in the desired context, ie something like this:
static bool SceneWinOnly()
{ return EditorWindow.focusedWindow is UnityEditor.SceneView;}
[MenuItem("Scene/Scene/Fly Camera Down _PGDN", true)]
static bool EnableFlyDown() { return SceneWinOnly();}
couetcouet88
Sep 27, 2018 07:18
Same problem in 2018.2.7
Aeroxima
Aug 14, 2018 23:48
Still a problem in 2018 =/
Would really like to be able to make and use hotkeys, and also still type words without letters being eaten.
FeastSC2
Apr 14, 2017 03:27
I have the same issue in 5.6 please fix this!
mcarriere
Oct 21, 2016 01:02
This also occurs on 5.5.0b7 on Windows (but not OSX)
Team-Beachbum
Oct 10, 2016 21:53
This problem seems unique to Windows Unity. I don't have this problem on OSX. I haven't tested on Linux, however.
SarfaraazAlladin
Jul 05, 2016 21:54
Same issue in 5.3.4f1 Would love to see this resolved, as I have some custom tools that would be great to access from a single key press.
hexagonius
Apr 23, 2016 07:57
The problem even exists when you try to type text into UI Text fields. The letters just gets swallowed by the MenuItem and the function executed. The hotkeys really should be ignored when any text field is focused or forced to at least one modifier key. Not that one can avoid it on its own.
babaqalex
Mar 24, 2016 21:52
have the same problem in 5.3.3f1