Godot: Editor randomly ignoring CTRL + Shortcuts

Created on 29 Apr 2019  路  17Comments  路  Source: godotengine/godot

Godot version:
3.1.1 Stable Win 64

OS/device including version:
Windows 10 Version 10.0.17763 Build 17763

Issue description:
Godot will randomly stop accepting any shortcut that uses the CTRL key. For example, pressing "CTRL+S" will switch to the scale tool instead of saving. Restarting Godot will fix it for either 5 seconds or 5 minutes.

Pressing control does cause the ruler to change, so it knows the key is being pressed. It's just ignoring it in combination with other keys.

I've tried updating windows, nuking my app data, upgrading godot, running as admin, compatibility settings, a different computer, sticky key settings, and whatever else I could think of.

Steps to reproduce:
I've been pulling my hair out trying to figure out what causes it. Sometimes it seems to happen after a parsing error. Sometimes it happens on its own. I can reproduce it on both of my laptops (surface go and hp spectre x360 15), but not on command. It has a mind of its own.

Minimal reproduction project:
Happens on any type of project. I've managed to trigger this on a brand new project with only 1 node and 1 script.

bug editor input

Most helpful comment

Another update:
I noticed that if you just press the Alt key, the shortcut keys work again. No need to restart the editor.

All 17 comments

Likely fixed by #28465. Could you try with latest master ?

@groud That should not be related, #28465 fixed a regression in the master branch which was not cherry-picked to the 3.1 branch.

@akien-mga ah indeed.
It's surprising, it looks exactly like the problem @mrcdk described on IRC, just before fixing it with #28465. Probably different sources though.

I can confirm, it's not the same issue as #28465. Pressing control doesn't fix the problem, and pressing S doesn't save. The only way to fix it is to completely exit Godot, but that only fixes it for a few minutes at most.

Can confirm as well. I'm running the latest 3.1.1.stable.
Pressing CTRL key causes ruler to change and when I'm in the the Script editor view, pressing CTRL puts underlines over all "navigate to" symbols, where normally the underline only appears when you mouse over a "navigate to" symbol while CTRL key is pressed.

When it's in this borked state, I noticed that CTRL+C will actually clear highlighted text in the editor. Basically you can't trust any CTRL+ key combo after the bug rears its head.

Restarting the editor fixes the issue temporarily, as @mostlysoftware describes.

@amisner2k Which operating system are you on? This bug could be OS-specific.

@amisner2k Which operating system are you on? This bug could be OS-specific.

Good call. I'm on Windows 10.

This is really bizarre, has no one else reported this or do not very many people use the keyboard shortcuts involving the CTRL key? @Calinou , were you able to reproduce this?

@amisner2k I haven't been able to reproduce this on Linux.

Maybe this is caused by accumulated input (similar to #27104)? To verify this, download the Godot source code, change the true to false on the line linked below then recompile the editor: https://github.com/godotengine/godot/blob/24e1039eb6fe32115e8d1a62a84965e9be19a2ed/editor/editor_node.cpp#L5441

See Compiling for Windows for instructions on how to compile Godot from source.

Ok, that is a good idea and something I'd like to do sometime in the near future. However, if someone on here already has 3.1.1.stable compiled and working on their Windows machine, then It'd be awesome if they could try flipping that true to false to see if it'd work real quick. Otherwise, I'll try it out when I get around to compiling Godot for myself. Either way, thank you @Calinou for that lead.

Just wanted to add that I did something I'm guessing others have done to work around this issue: remap some of the shortcuts to not use the Ctrl key.

However, when I did that, I noticed that it also seemed to fix the issue altogether. Before when the bug occurred, any shortcut key involving Ctrl would be mixed up. Ctrl+C would end up clearing an entire line in the Script Text editor for example, it was crazy. After I remapped Ctrl+S and Ctrl+Shift+S to simply be Alt+S and Alt+Shift+S, the Ctrl key would work again in the Script Text editor (I didn't have to restart Godot or anything). Very weird but for now, the workarounds aren't bad at all.

I still look forward to building Godot from source in the future and maybe this bug, if it still exists, will be my first adventure. This engine is quite simply...amazing.

Ok, so I discovered that the bug occurs consistently and the thing that triggers it is Alt+Tabbing away from Godot. So repro is:

  1. Have Godot open
  2. Alt+Tab to another window
  3. Go back to Godot window (via Alt+Tab or otherwise, doesn't matter)
  4. Ctrl+ shortcuts are messed up.

So something is going on with the Alt+Tab key combination in Godot. If I find time to build Godot's source myself, I'll dig further, but hopefully someone else more experienced can take up the mantle and find the issue quicker than I can.

Another update:
I noticed that if you just press the Alt key, the shortcut keys work again. No need to restart the editor.

This problem has really been bugging me, and I hadn't even considered that Alt+Tab might be the issue. I use that a lot, so it's no wonder than I kept running into this bug. Great insight and workaround, @amisner2k !

I tested the suggestion from @Calinou for changing that value from true to false and then recompiling Godot, and unfortunately the issue was still present. The workaround still worked, though. But we'll have to look elsewhere to actually fix it.

Thank you for taking the time to verify that @cur33, at least we can rule that out as a possible solution. And yeah, fortunately the workaround is quick and easy. :)

@amisner2k and others, the plot thickens: I've noticed that this issue only occurs when I use the right Alt button on my keyboard, and never the left. If I Alt-Tab away using with the left Alt (not something I usually do, which is why I haven't noticed til now), and then return to Godot, Ctrl+ shortcuts still work as expected. However, if I Alt-Tab away with the right Alt then return to Godot, I have to use the workaround of pressing right Alt (pressing left Alt does not fix it) before the Ctrl+ shortcuts work again.

For context, I'm on Windows 10, and confirmed this behavior on both 3.1.1 Stable (Mono) and 3.2 Stable (Mono); I just upgraded today.

I'd love to tackle this issue myself, but I don't really have the time right now and I've never contributed to Godot before so I'm not all that familiar with the codebase (although I do have C++ experience, so that helps). But since it's relatively low priority, then I'll definitely see if I can shed any light on this if the issue is still open when I have more time.

I also am having this in the latest 3.2 with win 10. Doesn't happen often, so I prematurely closed my issue https://github.com/godotengine/godot/issues/35844.

I recently had it happen when tabbing back into the editor. What I noticed was the script editor file menu was reduced to only File. Tabbing in and out again made the other elements return, and the shortcuts returned.

Not 100% though if it's the same issue, or if another exists regarding gui not being completely restored.

For those that can reliably reproduce it, you might see if other shortcuts are affected from the same areas as the CTRL+ ones you are using.

Was this page helpful?
0 / 5 - 0 ratings