Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Middle click not working with Windows 11 22H2 build 22621.1344 #82

Open
ptdev opened this issue Mar 13, 2023 · 7 comments
Open

Middle click not working with Windows 11 22H2 build 22621.1344 #82

ptdev opened this issue Mar 13, 2023 · 7 comments
Labels
bug Something isn't working

Comments

@ptdev
Copy link

ptdev commented Mar 13, 2023

Describe the bug

After updating to Windows 11 build 22621.1344, the middle click event no longer appears to be working and seems to be triggering the regular left-click.

The original project by @hardcodet also has the same issue, so I'm assuming it's most likely some change in Windows itself.

This project that uses this library also appears to be suffering from the issue as reported here.

Reporting here although I'm not sure this will be fixable or if this feature was actually removed from Windows.

Steps to reproduce the bug

Update to Windows 11 build 22621.1344
Bind something to the tray icon's middle click event

Expected behavior

Should trigger the middle click message

Screenshots

No response

NuGet package version

Latest

Platform

WPF

IDE

Visual Studio 2022

Windows Version

Windows 11

WindowsAppSDK Version

No response

WindowsAppSDK Type

None

Manifest

No response

Additional context

No response

@ptdev ptdev added the bug Something isn't working label Mar 13, 2023
@HavenDV
Copy link
Owner

HavenDV commented Mar 13, 2023

Thank you for your message. I tried to find information about the changes in the documentation, but I don't see any changes:
https://learn.microsoft.com/en-us/windows/win32/inputdev/wm-mbuttonup
https://learn.microsoft.com/en-us/windows/win32/inputdev/wm-mbuttondown
https://learn.microsoft.com/en-us/windows/win32/api/shellapi/nf-shellapi-shell_notifyiconw
I'll try adding WM_NCMBUTTONUP and WM_NCMBUTTONDOWN handling as a possible solution, but I'm not sure about that

@ptdev
Copy link
Author

ptdev commented Mar 13, 2023

Hi, thanks for the quick reply.

I've also searched their docs and release documents and couldn't find any change that would fit this observed behavior, but nevertheless, the issue is present on both this library and the original one.

I've added some Debug statements to see what is getting triggered when middle clicking and all I'm getting is the left mouse press event.

Unfortunately I'm not too knowledgeable on these native windows calls/messages so not really sure how I could proceed with some fix or workaround.

I'm willing to test/validate any fixes you may release. Thanks again.

@HavenDV
Copy link
Owner

HavenDV commented Mar 13, 2023

Middle events still work in 22621.1265. I will try to update Windows to test

I have also released a test version with support for WM_NCMBUTTONUP and WM_NCMBUTTONDOWN. It will be great if you test it. The package will be uploaded to NuGet automatically in about 10 minutes
4a5c913

By the way, I also added a MiddleClickCommand

@HavenDV
Copy link
Owner

HavenDV commented Mar 13, 2023

I've updated to 22621.1344 and can confirm that any mouse Middle events are replaced with similar Left events. The window also doesn't receive any other events than this, so I don't see a workaround. I think we need to wait a few updates to make sure it's not a bug

@ptdev
Copy link
Author

ptdev commented Mar 13, 2023

Thanks again for having a look at this and confirming its an actual issue.

It's a bit sad that this was removed without any further information or even being mentioned in the update's changelog.

I'm hoping this may eventually be fixed by Microsoft as I'm guessing there must be several applications that are using the middle click functionality and more people will probably start noticing this issue as they start updating their Windows.

Thanks again for the support. (Not sure if I should close this issue now or if you wish to keep it open, but feel free to close it as I'm guessing we're going to have to wait for some updates from MS for this to get solved)

Cheers

@ptdev
Copy link
Author

ptdev commented Mar 14, 2023

Just to add some more detail about this to confirm that this is definitely a change in this windows version and not in anyway related with this lib or even wpf or winui.

Creating a blank winforms app in visual studio and using winforms own Notifyicon class and capturing the mouseclick event, always fires left click when clicking the middle mouse. While on previous windows versions it correctly identifies it as middle.

I have since reported it to microsoft on twitter and they dmd me basically letting me know that I should report it through the feedback hub app. I have reported there too and asked for some more clarification about it, if it was intended or not, if it's mentioned anywhere, etc. Not very hopeful but we'll see..

@ptdev
Copy link
Author

ptdev commented Mar 22, 2023

Adding another update on this.

Microsoft has since released another Windows build (22621.1413) and unfortunately this issue is still present.

If anybody else is also hoping for this to be fixed, it may be worth upvoting or comment on the report I've filed through the Feedback Hub app.

You can see it here: https://aka.ms/AAk0sn4

Cheers, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants