Closed Bug 1615213 Opened 4 years ago Closed 3 years ago

Back & forward mouse buttons are detected as middle mouse button, on mac. Imice x7 gaming mouse.

Categories

(Core :: Widget: Cocoa, defect, P3)

73 Branch
defect

Tracking

()

RESOLVED FIXED
92 Branch
Tracking Status
firefox92 --- fixed

People

(Reporter: golubovicm, Assigned: mstange)

References

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:73.0) Gecko/20100101 Firefox/73.0

Steps to reproduce:

Connected my new Imice x7 gaming mouse to iMac, running Mojave 10.14.6.
https://www.aliexpress.com/item/32706439831.html

Actual results:

Forward and back mouse buttons are working as middle mouse buttons.

Expected results:

They should work as in other apps, provide forward and back actions. Buttons are working well in i.e. Chrome, Thunderbird, PHP Storm on same iMac. Also work well on FF on Windows.

When testing mouse buttons from firefox here: https://www.onlinemictest.com/mouse-test/
They work well. Problem is in Firefox...it doesn't handle events well.

Hi Milan
Sadly i don´t have that kind of mouse with those buttons to test.

Can you Please download the latest Firefox Nightly release from here: https://nightly.mozilla.org/ and retest the problem and let us know?

If you still have the issue please create a new profile, you have the steps here:https://support.mozilla.org/en-US/kb/profile-manager-create-and-remove-firefox-profiles?redirectlocale=en-US&redirectslug=Managing-profiles#w_starting-the-profile-manager

Lastly test if the issue is reproducible in safe mode, here is a link that can help you:
https://support.mozilla.org/en-US/kb/troubleshoot-firefox-issues-using-safe-mode

Regards
Pablo

Hello,

Tried nightly build but it acts the same - when I press back of forward button circle for scrolling appears, just as when I press middle mouse button.

I'll try other actions you suggested when I grab some time and in meanwhile maybe you can order that mouse. It's cool and it's cheap! :)

Regards,
Milan

Thanks Milan, It looks good, but its sold out already !

I will set the component of this bug as Widget:Cocoa since it looks like a Mac specific problem. Our devs might have the equipment to test this.

Regards
Pablo

Component: Untriaged → Widget: Cocoa
Product: Firefox → Core

Thank you.
It's definitely Mac specific - I have the same mouse on Win10 system and FF reads mouse buttons well there.
What's strange to me is that on Mac when opening that mouse test page (link I posted above) even on FF all buttons are read well. But just FF interface is not treating all 2 buttons (middle, back and forward) as middle one.

Priority: -- → P3

Hi folks,

I think I can confirm this bug as well. I have a Logitech G502 and experience the same behavior. The Logitech software says that the buttons are mapped to "Button 4" (for what's usually back) and "Button 5" (for what's usually forward).

For what it's worth, Chrome and the Electron-based Slack and Visual Studio Code handle these buttons as expected (back goes back, forward goes forward). Safari ignores them.

I confirm the same behavior in macOS with razer mamba elite, the buttons are treated as middle buttons both on FF. They work well on Chrome or FF in Windows.

I have tested this issue on FF 76.0.1 / Nightly / fresh install of FF / FF 76.0.1 in safe mode and the behavior is the same.

Status: UNCONFIRMED → NEW
Ever confirmed: true

Thanks, Stephen. My bug was definitely a duplicate - apologies, I searched for mouse4 and mouse5, not back and forward.

Confirming that this is definitely a Firefox specific, Mac specific bug.

Severity: normal → S3
Summary: Back & forward mouse buttons are detected sa middle mouse button, on mac. Imice x7 gaming mouse. → Back & forward mouse buttons are detected as middle mouse button, on mac. Imice x7 gaming mouse.

Mouse DEXP WM-1004BU, There are problems on mac, on Windows — ok

I can confirm this exact behavior with my mouse (SteelSeries Rival 110) on Mac. Fourth and fifth mouse buttons trigger back and forward in the same Firefox version (81.0) on Windows.

For anyone wondering, this is a macOS issue, not necessarily a Firefox issue. Firefox is just doing what the OS is telling it to do, so this isn't surprising. macOS doesn't handle the mouse4 and 5 button very well anywhere, and therefore, Safari, Finder, and other applications suffer from the same issue. Chromium browsers only have this functionality because they manually added it.

In the meantime, for anyone who found this bug and wants this functionality in Firefox, there is an open source app called SensibleSideButtons (not my creation) that makes mouse4/5 have backwards/forewards compatibility everywhere in macOS, including Firefox.

Theoretically if the anyone was interested in making this work, one could take a look at the workaround from SensibleSideButtons and add it to Firefox itself. The website offers a detailed explanation of how it works (scroll down to "Technical Notes").

I believe this happens with any mouse (I use some cheapo DELL MOCZUL) that has the navigation buttons, and doesn't come with "macOS software/drivers" to generate the swipe events.

These issues were reported as far back as 2017

The latter bug even suggests the non-Apple mouse buttons are supposed to work, out of the box in Firefox, but as of version 83.0, they don't.

Doesn't look like just a simple macOS issue, since this recognizes button 4 and button 5 as such:
https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/buttons

This just returns 1 (auxiliary button, middle button) when it should return 3 (button 4) or 4 (button 5):
https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button

The patch in bug 1704883 adds the necessary conversion functions.

Depends on: 1704883
Assignee: nobody → mstange.moz
Status: NEW → ASSIGNED

D111982 references members of nsCocoaUtils which don't exist (tried to build from source). When will this finally be fixed?

Flags: needinfo?(mstange.moz)

It seems after a recent update, this bug now also affects my Logitect MX Anywhere mouse.

This also affects a Logitech Hero mouse. Mouse buttons 4 and 5 are both detected as middle clicks

I can confirm this bug on my MacBook m1 with a Logitech MX master 3. Back and forward are working fine on chrome or other tools.

To be precise, it seems the problem only occurs when connected via Bluetooth. When I use the Logitech thingy to connect, all works fine.

(In reply to h from comment #24)

To be precise, it seems the problem only occurs when connected via Bluetooth. When I use the Logitech thingy to connect, all works fine.

Macbook Air M1; Logitech thing connected via my monitor, because the Bluetooth of the laptop is buggy anyway.

I can confirm this issue on my Mac M1 using a Logitech G502 connected via USB cable.

Attachment #9215675 - Attachment description: Bug 1615213 - Support special back/forward mouse buttons. r=spohl → Bug 1615213 - Support special back/forward mouse buttons. r=masayuki

Comment on attachment 9215675 [details]
Bug 1615213 - Support special back/forward mouse buttons. r=masayuki

Patch works great when it comes to mouse button functionality, but the MouseEvent.buttons demo no longer returns 8 or 16 as results when you press back/forward mouse buttons:

https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/buttons

Comment on attachment 9215675 [details]
Bug 1615213 - Support special back/forward mouse buttons. r=masayuki

https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button

This demo no longer returns anything. (Expected it to return 3 for back and 4 for forward.)

Thanks for testing! Yes, web pages will no longer see mousedown events when these buttons are pressed. This matches what Firefox on Windows does. But it does not match what Chrome does.

I think this patch is a good first step. As a follow-up, we can try to match Chrome's behavior, on all platforms.

Flags: needinfo?(mstange.moz)

(In reply to Markus Stange [:mstange] from comment #31)

As a follow-up, we can try to match Chrome's behavior, on all platforms.

I've filed bug 1720538 for this.

Pushed by mstange@themasta.com:
https://hg.mozilla.org/integration/autoland/rev/79a1b53dcccd
Support special back/forward mouse buttons. r=masayuki
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 92 Branch
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: