Repository: godot
Issue: 3D editor, `ctrl` remains pressed after closing (`ctrl s`) `Save Scene As...` window
Labels: bug,topic:editor,confirmed,topic:input,topic:3d

### Godot version

v3.5.beta2.official [7a4f9dfb1], v3.4.4.stable.official [419e713a2]

### System information

Windows 10

### Issue description

In the 3D editor. The `ctrl` key remains pressed,
after closing a window, that was opened with a `ctrl` shortcut.
For example: `ctrl s` (`Save Scene As...`) or `ctrl a` (`Create New Node`)

**Workaround**: Press and release the `ctrl` key once.

It happens when the window is closed by:
- pressing `enter` to accept the file name or the selected node
- `left` mouse clicking on the `cancel` button, top right `x` button, or outside the window

It doesn't happen when:
- the window is closed with `esc`
- the `Save Scene As...` window was opened from the menu: `Scene > Save Scene`
- the `Create New Node` window was opened from the Scene dock's `Add Child Node` button

This was discovered when the 3D editors `Use Snap (Y)` button,
seemed to become reversed after saving a new scene with `ctrl s`.

This issue doesn't seem to happen in the 2D editor.

### Related issue
There's a related issue where the `ctrl` key remains pressed when pressing `ctrl alt tab`:
"Use snap" button with "snap to grid" has inverted effect #26968

The issue is closed, but KoBeWi's comment https://github.com/godotengine/godot/issues/26968#issuecomment-490516437 still applies.
>I just found a way to reproduce it. Hold Control to invert snapping and press Alt + Tab. When you focus Godot again, the Control will be "stuck" until you press it again

The issue was closed as a duplicate of:
If you alt-tab off and in the editor and you drag a sprite it will act like if alt were pressed #12592

But the duplicate is only referring to the `alt` key remaining pressed.

The duplicate issue was closed after someone was unable to reproduce it in Linux.
The third from the last comment https://github.com/godotengine/godot/issues/12592#issuecomment-558611903 asked if it's reproducible in Windows.
I'm unable to reproduce the duplicate (`alt`) issue in Windows in either Godot 3.5.beta2, or 3.4.4.

But since the `ctrl alt tab` issue, still is reproducible:
"Use snap" button with "snap to grid" has inverted effect #26968

Then it probably should be reopened.

### Steps to reproduce

- Create a new scene
- Click on the button: `3D Scene` to add a `Spatial` node
- Make sure that the `Use Snap (Y)` button is disabled (above the viewport)
- In the 3d viewport, move the `Spatial` node by dragging the red arrow.
Observe that the node moves by decimal values. It doesn't snap (as expected).
- Now press `ctrl s` to open the `Save Scene As...` window
- `Left` mouse click on the `Cancel` button
- In the 3d viewport, move the `Spatial` node by dragging the red arrow.

### Expected
Dragging the red arrow shouldn't snap, because the `Use Snap (Y)` button is disabled.

### Observed
Dragging the red arrow now snaps to integer values.
Even though, the `Use Snap (Y)` button is disabled.

The same thing happens in reverse if the `Use Snap (Y)` button was enabled,
before the `ctrl s` (`Save Scene As...`) window was opened.

### Workaround
Pressing and releasing `ctrl`, restores the expected behavior.

### Minimal reproduction project

_No response_