godotengine / godotengine/godot

MouseButton Keys do not get cleared when debugging in VisualStudio (C#)

Open
#90,212 1 comment 0 reactions 0 assignees View on GitHub
bug topic:dotnet topic:input
Dominant language
C++
Stars
117k
Forks
26.8k
PR merge metrics
PR metrics pending

Description

### Tested versions

Reproducible in Godot v4.2.1-stable-mono-win64 & Visual Studio 17.8.1

### System information

Godot v4.2.1.stable.mono - Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 2070 (NVIDIA; 31.0.15.3758) - AMD Ryzen 7 3700X 8-Core Processor (16 Threads)

### Issue description

When debugging a C# Script in the Visual Studio IDE and stopping at a brakepoint, while listening for Mouse Inputs, the Button Status does not reset between calls. This only occours when starting the program diredtly via the VisualStudio debugger. When executed in the Godot Enginge directly the state gets cleared as expected.

### Steps to reproduce

1. Create new Project
2. Configure VisualStudio debugging
3. Add C# Script with the following code to a Node
```csharp
public override void _Input(InputEvent e)
{
switch (e)
{
case InputEventMouseButton:
if (Input.IsMouseButtonPressed(MouseButton.Left))
{
MouseButtonMask x = Input.GetMouseButtonMask();
GD.Print(x);
}
break;
}
}
```
4. Add breakpoint
5. Execute program in VisualStudio (F5) and click left mouse button
6. Resume program after breakpoint is reached
7. Click any other mouse button

### Minimal reproduction project (MRP)

[BugTest.zip](https://github.com/godotengine/godot/files/14874864/BugTest.zip)

Contributor guide

Open the contributing guide

Research direction

Start with the attached BugTest.zip and reproduce the issue using the reported Godot 4.2.1 Mono and Visual Studio setup. Read the C# Node _Input example and compare behavior when launched from Visual Studio versus Godot; done means mouse-button state no longer remains set after resuming from a breakpoint and subsequent clicks report the expected state.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, godot
Domain
devtools, game-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.