FooSoft / yomichan

Japanese pop-up dictionary extension for Chrome and Firefox.
https://foosoft.net/projects/yomichan
Other
1.06k stars 213 forks source link

[Feature Request] LMB and RMB and side mouse button inputs for shortcut keys #2191

Open ChubYee opened 2 years ago

siikamiika commented 2 years ago

As far as I know, side mouse buttons cannot be bound to anything but the default action navigating history in all major browsers supported by Yomichan. Main, auxiliary and secondary (usually LMB, MMB, RMB) [1] and mouse wheel [2] can.

Even setting mousebutton.4th.enabled and mousebutton.5th.enabled to false in Firefox doesn't make the MouseEvent fire with values 3 and 4 (indexing starts from 0) when side buttons are clicked.

However, binding just mouse buttons to Yomichan actions would also interfere with the default functionality of the website such as clicking links or scrolling. Would your use case involve a modifier key or just (a) mouse button(s)?

As a workaround, you can use free tools such as AutoHotkey on Windows [3] to bind mouse buttons to key events in different contexts such as having a browser window and a modifier key active.

  1. https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button
  2. https://developer.mozilla.org/en-US/docs/Web/API/Element/wheel_event
  3. https://www.autohotkey.com/