Unwanted editor hotkeys in game mode

Hi, everyone.

So I was going to use the holding of a Ctrl key for crouching of my game character, while moving it with typical WASD - nothing too fancy, quite usual key mappings.
However, it seems to be impossible in editor’s game mode, because Ctrl+A, Ctrl+S and Ctrl+D are not detected by Event.keyCode and still act as editor hotkeys, while doing nothing useful at all except for Ctrl+S which stops the game to show me the error “You must exit play mode to save the scene!”. Well what’s the point of even detecting these hotkeys in game mode?

Is there any workaround for making Ctrl useable in game mode? I obviously can use some different key, but I really used to Ctrl for crouching and there is no adequate reason to change my habits.

4 Likes

Go to PREFERENCES and redefine the keys shortcuts.

Personally, I erased all the terrain shortcuts because they were messing with navigation.

Sure is, when on play mode the editor shortcuts would be good if disabled.

Oh yes, I forgot to mention that THESE hotkeys are not redefinable!

Hi!

I’ve just run into the same problems: My game’s control scheme has cases where “ctrl” and “s” are pressed simultaneously, which the unity editor interprets as the saving shortcut.

Is there a way to disable editor hotkeys while in game mode, or another workaround for this issue? Surely wasd + ctrl isn’t such an unusual control scheme, that Mr. F and I are the only ones who ran into it, right?

2 Likes

Bump.

Typical First person shooter controls are “ctrl” to crouch and “s” to move backwards. So “ctrl+s” is moving backwards while crouched.

Can unity editor shortcuts be disabled while playing …except “ctrl+p”, i need that :wink:

4 Likes

Same problem for ctrl + wasd here… any solution ? :confused:

2 Likes

this sucks

3 Likes

Having the same problem, it’s been years this problem is happening - no solution or workaround exists yet?

1 Like

why is this still an issue? there even is an issue in the issue tracker that’s more than 3 years old and it’s marked as “postponed”: https://issuetracker.unity3d.com/issues/disable-editor-keyboard-shortcuts-while-playing

2 Likes

I NEED THIS, COME ON UNITY. Editor Shortcuts in Play Mode steals all the shortcuts I need ingame!

Same problem here. I’m implementing an undo system, but when I want to test it, Unity messes things up by undoing stuff in the editor.

4 Likes

Same issue as Zogg; I have an in-game level editor where I’ve setup the CTRL-Z hotkey to undo the last action, which of course is conflicting with the editor.

3 Likes

Create two set of keys, one for editor and one for runtime then just use the conditional check for editor.

1 Like

@zombiegorilla , is there a resource we can use for more information on this? I just ran into the problem.

Bump, I guess?

Having two sets of keys is not an answer at all. A game with a complex control scheme must be tested with a specific set of keys in mind to see if it’s convenient to access and use them. It’s rather critical for UX design.

I don’t see any other way now but to build the project each time I need to see if the control scheme is ok. But UX issues generally require iterative approach, so it means a lot of builds, and this is just a crazy waste of time because of an issue that shouldn’t be incredibly hard to resolve on Unity’s side.

So, please, add the “If (Application.isEditor)” on the engine side.

4 Likes

This allows us to disable our custom hotkeys in our code - but not Unity’s default hotkeys! What if i want Ctrl-S to stop being “Save Scene” and start being “Do Something In-game” during play mode inside the editor? We do not want to disable our custom hotkeys, but Unity’s default ones!

More than that, Application.isEditor is always true in editor, play mode or not. We could also use Application.isPlaying, but again, it works only for our own code and thus - our own hotkeys. We still need a real solution here.

I agree it’d be great to disable shortcuts mid game scene. A temporary work around for me was just testing my crouching functionality with a Build and Run and it worked as expected though this is only a short term solution.

Bump. Surely no one puts up with this? It seems like a major oversight. How on earth are there so many Unity-made games with such a critical flaw in the testing process?

1 Like

2019.1
https://docs.unity3d.com/2019.1/Documentation/ScriptReference/ShortcutManagement.IShortcutManager.html

1 Like