NEW 280755
[macOS & iPadOS] The wrong values for are reported for the `MouseEvent.button`& 'MouseEvent.which' property for extra mouse buttons.
https://bugs.webkit.org/show_bug.cgi?id=280755
Summary [macOS & iPadOS] The wrong values for are reported for the `MouseEvent.button...
Jeffrey Blanz
Reported 2024-10-02 07:50:12 PDT
Created attachment 472765 [details] Video of Difference with Chrome vs Safari When using a mouse that has extra buttons, safari does not recognize the other buttons as anything other than the middle mouse button. You can see this happening with Geforce Now. With Chrome, when you press the 5th mouse button, Chrome correctly recognizes the 5th mouse button. With Safari, when you press the 5th mouse button, Safari thinks the button you are pressing is the middle mouse button.
Attachments
Video of Difference with Chrome vs Safari (38.30 MB, video/mp4)
2024-10-02 07:50 PDT, Jeffrey Blanz
no flags
Radar WebKit Bug Importer
Comment 1 2024-10-09 07:51:18 PDT
Abrar Rahman Protyasha
Comment 2 2024-10-09 13:39:36 PDT
Hi Jeffrey, thanks for filing the issue. Asking a clarification question: I suppose what you really want to report is that the `MouseEvent.button` property is incorrect when clicking the 5th button?
Abrar Rahman Protyasha
Comment 3 2024-10-09 13:44:04 PDT
Interestingly, we get this right for the `MouseEvent.buttons` property! (as tested on https://unixpapa.com/js/testmouse.html)
Abrar Rahman Protyasha
Comment 4 2024-10-09 13:55:16 PDT
At any rate, this bug is a result of our inability to respect `NSEvent.buttonNumber` when creating platform event representations from NSEvent.
Jeffrey Blanz
Comment 5 2024-10-09 15:21:50 PDT
(In reply to Abrar Rahman Protyasha from comment #2) > Hi Jeffrey, thanks for filing the issue. Asking a clarification question: I > suppose what you really want to report is that the `MouseEvent.button` > property is incorrect when clicking the 5th button? Yes, and not just the 5th mouse button, but any mouse button besides Right Click, Left Click, and the middle mouse button.
Jeffrey Blanz
Comment 6 2024-10-09 15:24:04 PDT
But as you stated before, I think the mouseevent.buttons property works, but it is a different property that geforce now uses that does not.
Jeffrey Blanz
Comment 7 2024-10-09 15:34:01 PDT
(In reply to Abrar Rahman Protyasha from comment #3) > Interestingly, we get this right for the `MouseEvent.buttons` property! (as > tested on https://unixpapa.com/js/testmouse.html) Actually I do not get it correct when using this website in safari vs chrome. When using a mouse that has a 4th or 5th button I click it and get this for safari: mousedown which=2 button=1 buttons=16 mouseup which=2 button=1 buttons=0 I get this for the same button on chrome: mousedown which=5 button=4 buttons=16 mouseup which=5 button=4 buttons=0 Notice how the "buttons" are the same (16), but the "button" (4 vs 1) is not.
Abrar Rahman Protyasha
Comment 8 2024-10-09 15:38:54 PDT
That's exactly right, we report wrong values for `MouseEvent.button`.
Jeffrey Blanz
Comment 9 2024-10-21 11:20:05 PDT
And GeForce Now uses that property to assign buttons. So this would need to be fixed to fix the issue.
Jeffrey Blanz
Comment 10 2024-10-30 07:34:03 PDT
Using this demo these are all the errors for macOS, iOS, iPadOS, and visionOS https://unixpapa.com/js/testmouse.html : I a testing this on safari for all platforms, including STP and Chrome Canary as a comparison. I am using the M720 Triathlon mouse by Logitech which has two extra mouse buttons on the side. ____________________________________________________________________ On macOS the wrong values are reported for the which and button property for extra Mouse Buttons: Extra Mouse button 1 on Safari for macOS : mousedown which=2* button=1* buttons=8 mouseup which=2* button=1* buttons=0 What Extra Mouse button 1 should be: mousedown which=4 button=3 buttons=8 mouseup which=4 button=3 buttons=0 Extra Mouse button 2 on Safari for macOS: mousedown which=2* button=1* buttons=16 mouseup which=2* button=1* buttons=0 What Extra Mouse button 2 button should be: mousedown which=5 button=4 buttons=16 mouseup which=5 button=4 buttons=0 ____________________________________________________________________ On iOS, iPadOS, and visionOS the wrong values are reported for the which, button, and buttons properties for all mouse buttons besides the right or left click: Middle Mouse Button & all Extra Mouse Buttons: mousedown which=1* button=0* buttons=1* mouseup which=1* button=0* buttons=0 click which=1* button=0 buttons=0 Middle Mouse should be: mousedown which=2 button=1 buttons=4 mouseup which=2 button=1 buttons=0 Extra Mouse button 1 should be: mousedown which=4 button=3 buttons=8 mouseup which=4 button=3 buttons=0 Extra Mouse button 2 button should be: mousedown which=5 button=4 buttons=16 mouseup which=5 button=4 buttons=0 ________________________________________________________________________ On iOS, not iPadOS, the incorrect 'buttons' is reported for a right click as well as the others above: mousedown which=1 button=0 buttons=0* mouseup which=1 button=0 buttons=0 click which=1 button=0 buttons=0 Should look Like: mousedown which=1 button=0 buttons=1 mouseup which=1 button=0 buttons=0 click which=1 button=0 buttons=0 _________________________________________________________________________ * wrong values
Abrar Rahman Protyasha
Comment 11 2024-10-30 10:24:14 PDT
Hi Jeffrey! Thanks a lot for looking into this. I'll use this bug to track the fact `MouseEvent.button` is incorrect for auxiliary buttons, and will follow up with new bug reports for the other anomalies.
Abrar Rahman Protyasha
Comment 12 2025-01-16 16:42:33 PST
We should probably consider addressing webkit.org/b/267801 at the same time, to make sure we can do testing.
Note You need to log in before you can comment on or make changes to this bug.