dotnet / dotnet/wpf

Unexpected MouseMove Event with External Mouse

Open
#7,506 4 comments 0 reactions 0 assignees View on GitHub
Investigate
Dominant language
C#
Stars
7.7k
Forks
1.3k
Avg merge
1d 11h
Merged PRs (30d)
61

Description

### Description

I am experiencing an issue with the mouse events in the .NET framework. When I perform a fast click, release, and move with an external mouse, the `PreviewMouseLeftButtonDown,` `MouseMove,` and `MouseLeftButtonUp `events are fired. I expect the `PreviewMouseLeftButtonDown ` and `MouseLeftButtonUp ` events to be fired as I am clicking and releasing the mouse button. I have attached a code sample that demonstrates the issue. Can you please check this issue and provide a solution?

[WPFDemo.zip](https://github.com/dotnet/wpf/files/10673913/WPFDemo.zip)

### Reproduction Steps

1. Run the provided sample and observe the Console output.
2. Click, release, and move the mouse quickly.
3. Observe the Console output again.

### Expected behavior

When clicks and releases the mouse quickly, the PreviewMouseLeftButtonDown and MouseLeftButtonUp events should be fired, and the MouseMove event should not be fired.

### Actual behavior

When clicks and releases the mouse quickly, all three events, PreviewMouseLeftButtonDown, MouseLeftButtonUp, and MouseMove, are fired.

### Regression?

_No response_

### Known Workarounds

_No response_

### Impact

_No response_

### Configuration

_No response_

### Other information

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.