Bug 47099 - [Keybindings] preference page: Key config should allow mouse buttons
Summary: [Keybindings] preference page: Key config should allow mouse buttons
Status: ASSIGNED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.0   Edit
Hardware: All All
: P5 enhancement with 18 votes (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard:
Keywords: helpwanted
: 27517 49815 51199 63868 73239 87232 91151 99630 (view as bug list)
Depends on:
Blocks: 84776 71406 88788 106873 115281
  Show dependency tree
 
Reported: 2003-11-20 10:59 EST by nikolaus heger CLA
Modified: 2021-02-11 04:07 EST (History)
32 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description nikolaus heger CLA 2003-11-20 10:59:17 EST
It would be very natural to assign my mouse button 4 to the "navigate->back"
function (alt-left_arrow). 

that would allow me to navigate entirely with the mouse: ctrl-click to jump to
class definitions, and back-click to jump backwards. as it is, i either have to
find the back button (still faster than keyboard) or use the key combinations.

it would also be nice to assign new functionality to shift-click and so on.
rather than hard-code this into the IDE (as bug 27517 suggests) it would be
natural to add it to the list of key shortcuts. 

as for buttons 4 and up being non-standard, look no further than quake3 to see
how this is done. the interface needs to be interactive like that, and then
there is no question which button on the mouse is button 4 - key settings go
through the system and don't have to be guessed by the user (as it is now).

[this is related to bug #27517 - allow back and forward mouse buttons]
Comment 1 Grant Gayed CLA 2003-11-20 12:45:21 EST
Moving to ui since this is where user configuration would be done.  Of course 
offering this would be dependent upon swt providing the help, so if ui plans to 
look into this then you may need to log an enhancement request with swt.
Comment 2 Douglas Pollock CLA 2003-12-02 12:50:30 EST
This enhancement makes me smile.  :)  We were already thinking of providing
gesture and mouse binding support, but looking for an excuse.  Do you have any
interest in mouse gesture support?
Comment 3 Nikolay Metchev CLA 2003-12-02 12:55:32 EST
just in case nobody is not aware about this. I have a microsoft intellipoint 
mouse and the driver allows you to assign special actions to the buttons. I 
have assigned to the thumb button the "Back" action via the microsoft driver. 
In eclipse the thumb button acts as alt-left_arrow. I know that this isn't a 
solution but more like a hack but I thought I would mention it so people can 
use it in the meantime!
Comment 4 Chris McLaren CLA 2003-12-05 13:08:43 EST
(this isn't exactly mouse button 4+ support, but)

for a brief period about a year ago i put mouse gesture recognition into 
eclipse (for like one integration build..), it worked the same as mozilla and 
opera's mouse gestures. this code is not stale. i has gestures working in the 
text editor only, and required you to press the right mouse button.

it was only pulled because of an issue on motif and mac - their contexts menus 
appear on the mouse-down. mozilla handles this simply by allowing you to 
choose you mouse button (say button 4+) and/or requiring a modifier key to be 
held. we didn't add this preference (and save mouse gestures) for this simple 
reason. no cycles. and it just got left, even though *I* thought it was the 
coolest feature (i guess because i wrote it.. :)

now that we have mouse events coming through the display filter, we could add 
gestures application-wide. hmm..

gestures could be as configurable as key bindings with little effort: gestures 
could simply generate special key strokes, and doug's 'keysequencetext' (or 
another text control) could simply add a gesture capture listener (already 
done) to allow gesture strokes to be inserted instead of key strokes.

anyway.. small amount of work. big gain. i wish i wasn't so swamped with the 
boring stuff..
Comment 5 Douglas Pollock CLA 2004-02-09 11:06:21 EST
*** Bug 51199 has been marked as a duplicate of this bug. ***
Comment 6 Nick Edgar CLA 2004-02-09 11:19:06 EST
Bug 51199 also discusses the Back and Forward keys on a laptop.  Not sure if 
these generate key events or mouse events.
Comment 7 nikolaus heger CLA 2004-02-29 05:52:00 EST
in answer to the question of "which event gets generated by non-standard button
X?": it doesn't matter if the settings dialog is interactive. 
 
1) click on "define shortcut for action X"
2) a dialog comes up. press any key combination / mouse key combination or even
make a mouse gesture. the dialog captures it, and displays it as well as it can.
e.g. maybe "button 4" appears, maybe something else ("unknown key #1"). but in
any case, button 4 is now tied to the action. leave it to the system to deal
with which exact event is generated, but do what the user expects. 

most games work this way (hence my reference to Quake3, there is a free
download).. it has the advantage of being system-independent.
Comment 8 Douglas Pollock CLA 2004-09-07 16:02:34 EDT
*** Bug 73239 has been marked as a duplicate of this bug. ***
Comment 9 Douglas Pollock CLA 2004-09-28 12:36:00 EDT
*** Bug 63868 has been marked as a duplicate of this bug. ***
Comment 10 Michael Scharf CLA 2004-10-03 23:28:55 EDT
For a new user it is not clear what the effect of a double-click is for most 
of the views. The only way to find out is to actually try it. There should be 
an indication in the UI (e.g. the context menu or tooltip).....
Comment 11 Douglas Pollock CLA 2004-12-15 14:12:56 EST
*** Bug 27517 has been marked as a duplicate of this bug. ***
Comment 12 Douglas Pollock CLA 2005-03-06 10:55:35 EST
*** Bug 87232 has been marked as a duplicate of this bug. ***
Comment 13 Sergey Prigogin CLA 2005-03-26 14:39:00 EST
The solution mentioned in comment 3 stopped working with IntelliPoint 5.0 and 
above. I tested Back and Forward mouse buttons with three versions of 
IntelliPoint with the following results:

4.1 Works
5.0 Doesn't work
5.2 Doesn't work

Please increase priority of Back/Forward button support. Old IntelliPoint 
versions don't work with new mouse models and are not available for download 
anymore. Steve Northover mentioned that SWT now supports 4th and 5th mouse 
buttons, so supporting them in UI should not be a problem.
Comment 14 Nikolay Metchev CLA 2005-03-26 20:53:28 EST
intellimouse 4.12 driver is available to download from:
http://www.softwarepatch.com/utilities/intellimouse.html
which for me ended up pointing to:
http://download.microsoft.com/download/4/8/c/48ca781f-a1be-4cdc-8d97-
dfc33535d4da/IP4_12EngALLMsi.exe
in case somebody actually needs them as a workaround to the back/forward 
problem.
Comment 15 Sergey Prigogin CLA 2005-04-11 23:08:17 EDT
Unfortunately my Wireless IntelliMouse Explorer 2.0 is not supported by 
IntelliPoint 4.12. Please raise the priority of this issue to get it fixed in 
3.1.
Comment 16 Douglas Pollock CLA 2005-04-18 10:32:02 EDT
*** Bug 91151 has been marked as a duplicate of this bug. ***
Comment 17 Chris Beck CLA 2005-06-07 14:01:19 EDT
Douglass, Chris - re comments #2, #4 and support for Mouse Gestures - Yes please!
See bug 88986
https://bugs.eclipse.org/bugs/show_bug.cgi?id=88986
Comment 18 Sergey Prigogin CLA 2005-06-07 14:16:42 EDT
Mouse gestures are good, but they are much bigger feature than support for 
additional mouse buttons, which are already supported by SWT. It seems to make 
sense to split this bug into two - one for mouse buttons and another one for 
gestures.
Comment 19 Douglas Pollock CLA 2005-08-03 13:32:44 EDT
*** Bug 99630 has been marked as a duplicate of this bug. ***
Comment 20 Sergey Prigogin CLA 2005-10-20 11:51:32 EDT
This enhancement request will soon celebrate its second birthday. Please 
consider it for 3.2.
Comment 21 BoD CLA 2006-01-09 12:22:55 EST
I agree with comment 18 saying that this bug is about allowing binding to mouse clicks, the problem of mouse gesture being a different ("harder") request. It should be assigned to another number. 
Resolution of this bug would also resolve bug #106873 which IMHO is important too.
Comment 22 Michael Van Meekeren CLA 2006-04-21 13:14:36 EDT
Moving Dougs bugs
Comment 23 Victor Toni CLA 2006-04-22 14:09:10 EDT
Is there a timeframe for this bug?
I have way to many buttons which are of no use ;-)
Comment 24 Simon Kaegi CLA 2007-05-04 11:25:08 EDT
(In reply to comment #13)
You can at least map the buttons to alt-left and alt-right again with the intellimouse 6.1 driver. I'm using 3.3M7
Comment 25 Sergey Prigogin CLA 2007-05-04 12:22:45 EDT
(In reply to comment #24)
Do you have a recipe for Linux (Ubuntu Daper)?
Comment 26 klaymen CLA 2007-10-31 00:32:12 EDT
I would also be very happy to see this feature implemented.
Comment 27 Felipe Heidrich CLA 2008-06-03 13:42:57 EDT
*** Bug 49815 has been marked as a duplicate of this bug. ***
Comment 28 Markus Keller CLA 2010-10-18 06:02:48 EDT
If mouse buttons are added to the Keys preference page, there should also be a way to configure whether
- the command should just be executed (e.g. when binding "Navigate > Back" to mouse button 4), or
- mouse button 1 should be clicked and then the command should be executed (e.g. when binding "Navigate > Open Declaration" to mouse button 2).

Furthermore, mouse clicks probably need more fine-grained activation scopes. E.g. Middle-click on a tab should close the part (implemented in bug 156792) but middle-click in a text editor should open the declaration and middle-click in a browser should open the link in a new editor.

I think we should just go forward and hardcode the most-often requested defaults for now (bug 88788, bug 106873).
Comment 29 David Byrne CLA 2010-12-28 16:35:47 EST
Seven years in the making... Please add this feature. It would be very nice.
Comment 30 Paul Webster CLA 2011-03-24 18:08:18 EDT
Here are some hints:

You need a MouseButtonBinding (similar to KeyBinding, derived from Binding)

You need a TriggerSequence that's a MouseButtonSequence

You need to represent the buttons in the in the keys preference page somehow, so they can be bound.  i.e. they need to either be captured by the text field or filled in from the dropdown.

You need to be able to ask the BindingManager for a TriggerSequeence that can look up the MouseButtonSequence to pick up MouseButtonBinding.

You need a filter that can deal with those events and process them correctly ... see something similar to WorkbenchKeyboard (maybe an extra filter there).

PW
Comment 31 Markus Keller CLA 2011-03-31 12:33:21 EDT
(In reply to comment #30)
That's a technical description, but before we put any work into implementing new infrastructure for an unclear problem statement, we first need real cases where the infrastructure will be used.

As outlined in comment 28, handling of mouse clicks is different from handling of key strokes, and any plan for a new general infrastructure needs to give answers to those problems first.

Like we hardcode mouse buttons 1 and 3 now, we should just to the same for the other buttons (bug 88788, bug 106873).
Comment 32 nikolaus heger CLA 2011-03-31 12:52:32 EDT
Since this is now 7 years in the making, maybe it needs to be de-scoped?

I just noticed something in XCode 4: Three finger swipe left / right is forward / back.  I am in heaven. That would be good enough for me. Note that back when I made this feature request, Macs didn't even have multi-finger gestures on the trackpad.

Maybe if detecting buttons in the same UI as keyboard presses is too hard, you could just have a separate mouse buttons assignment preference pane? Making mouse button 3 or 4 equivalent to a keyboard shortcut surely can't be that hard?! Would work just as well. Add a new preference pane, call it Mouse Buttons, and allow some simple settings for the mouse buttons. If that can include trackpad gestures would be even nicer - but I realize those are a Mac-only thing.
Comment 33 Sergey Prigogin CLA 2011-03-31 13:26:08 EDT
(In reply to comment #31)
> That's a technical description, but before we put any work into implementing
> new infrastructure for an unclear problem statement, we first need real cases
> where the infrastructure will be used.

The main use case is to make mouse Back button work on Linux. On Windows there is a workaround based on remapping in IntelliPoint.
Comment 34 Markus Keller CLA 2011-03-31 13:33:30 EDT
(In reply to comment #32)
Please file a separate bug for gestures support. SWT added GestureListener in 3.7, and we should see if that's enough to support back and forward gestures.


(In reply to comment #33)
> The main use case is to make mouse Back button work on Linux. On Windows there
> is a workaround based on remapping in IntelliPoint.

Exactly. This doesn't need to be configurable, it just needs to work. I attached a patch to bug 88788 for this.
Comment 35 Sergey Prigogin CLA 2011-03-31 13:38:13 EDT
(In reply to comment #34)
> Exactly. This doesn't need to be configurable, it just needs to work. I
> attached a patch to bug 88788 for this.

Thank you very much! I like pragmatic solutions.
Comment 36 Albert Tregnaghi CLA 2016-12-07 03:15:08 EST
A collegue uses IntelliJ and showed me the key bindings there - it's possible to define Mouse clicks, Wheel events etc. there to launch "commands" there.

So it was very easy for him to change the zoom feature from keyboard short cut to a mouse shortcut.

This is something IntelliJ is able to but eclipse not. I would appreciate if eclipse could do this too.

Like M1, M2 etc. inside plugin.xml configurations a MOUSE_CLICK_LEFT, MOUSE_CLICK_RIGHT etc. could be used in text form to apply in plugin.xml too and not only at keyboard bindings on UI.
Comment 37 Pierre-Yves Bigourdan CLA 2018-09-28 05:11:15 EDT
Same as @Albert: working with a colleague using IntelliJ and is has really good support for mouse bindings. Would really be a nice feature to add proper handling to Eclipse as well.
Comment 38 Michael Dibbets CLA 2021-02-11 04:07:47 EST
It's 2021 now. Such a relatively simple feature request to implement dynamic keybindings shouldn't be this difficult to organize. Just listen to any events thrown by https://docs.oracle.com/javase/8/docs/api/index.html?java/awt/event/KeyEvent.html and save type, buttons pressed + masks. You already have code matching everything to combinations. Just make the list that makes up the combinations dynamically configurable by the user by capturing inputs and putting that in the matching list.

Since Java7 it's possible to listen to more than the 3 mouse buttons, https://stackoverflow.com/questions/7644842/how-can-i-use-the-back-and-forward-mouse-buttons-in-a-swing-application 

Having to switch between keyboard and mouse constantly when looking for a certain file, is very tedious when having to do this a lot of times.
Currently, I have to use a third-party application like http://dvps.highrez.co.uk/downloads/XMouse_installed.htm?Platform=x64?version=2190200 to make my own key combinations, but I would find it more desirable to be able to configure this in eclipse directly.