Bug 88788 - [KeyBindings] request: Back/Forward keys and mouse buttons don't work with Eclipse
Summary: [KeyBindings] request: Back/Forward keys and mouse buttons don't work with Ec...
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P2 normal with 2 votes (vote)
Target Milestone: 4.2.1   Edit
Assignee: Markus Keller CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 113153 384092 (view as bug list)
Depends on: 47099 89228
Blocks:
  Show dependency tree
 
Reported: 2005-03-22 14:37 EST by Sergey Prigogin CLA
Modified: 2012-08-23 06:31 EDT (History)
13 users (show)

See Also:
pwebster: review+


Attachments
Fix (3.92 KB, patch)
2011-03-31 13:23 EDT, Markus Keller CLA
no flags Details | Diff
Fix for Linux (862 bytes, patch)
2011-05-04 21:13 EDT, Markus Keller CLA
no flags Details | Diff
Fix for 4.2.1 (3.24 KB, patch)
2012-07-10 13:06 EDT, Markus Keller CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sergey Prigogin CLA 2005-03-22 14:37:23 EST
Back and Forward keys on MS Internet keyboard don't trigger Backward History 
and Forward History commands even though Alt-Left and Alt-Right key sequences 
do trigger them. There is no way to map a command to Back or Forward keyboard 
keys or to extra buttons of a 5-button mouse.
Comment 1 Douglas Pollock CLA 2005-03-23 09:41:33 EST
For the mouse problem, please see Bug 47099.

Could you turn on a some key debugging options and run Eclipse?  I don't have a
Microsoft Keyboard, so I don't know what key codes are generated when they are
pressed.

You will need to create a file some on disk called "options".  In it put the
following 4 lines:  
  
        org.eclipse.ui/debug=true
        org.eclipse.ui/trace/keyBindings=true  
        org.eclipse.ui/trace/keyBindings.verbose=true  
  
Then, open a command prompt and run Eclipse.  Start Eclipse with the following  
additional parameter:  
  
        -debug C:\path\to\options  
  
Then simply press the forward and back keys.  Include the output from the
command prompt.
Comment 2 Sergey Prigogin CLA 2005-03-26 14:24:05 EST
Back, Forward and other internet/multimedia keys don't generate any output in 
the console window. The rest of the keyboard keys do produce quite a bit of 
console output. I tested with both 3.1 M5a and 3.0.2.
Comment 3 Sergey Prigogin CLA 2005-03-27 18:14:04 EST
Here are two links that contain info on Back/Forward keys:
http://www.chipx86.com/linuxstuff/officekb/keycodes.php
http://msdn.microsoft.com/library/default.asp?url=/library/en-
us/winui/winui/WindowsUserInterface/UserInput/VirtualKeyCodes.asp
Comment 4 Douglas Pollock CLA 2005-10-20 09:28:15 EDT
*** Bug 113153 has been marked as a duplicate of this bug. ***
Comment 5 Michael Van Meekeren CLA 2006-04-21 13:14:44 EDT
Moving Dougs bugs
Comment 6 Paul Webster CLA 2006-09-28 11:00:55 EDT
There are currently no plans to work on this feature.

PW
Comment 7 Denis Roy CLA 2007-06-22 09:32:50 EDT
Changes requested on bug 193523
Comment 8 Ulrich Hobelmann CLA 2008-04-03 05:14:13 EDT
With Milestone 6, alt-left + alt-right do not work for me (Java perspective, Java editor).  Should I open an extra bug for that?
Comment 9 Ulrich Hobelmann CLA 2008-04-03 05:19:45 EDT
I just noticed that alt+ctrl generally did not work (until I restarted Eclipse), so it's not related to this bug in any way.  Sorry.
Comment 10 Markus Keller CLA 2010-08-30 13:28:11 EDT
Until bug 47099 is fixed, I think we should just hardcode mouse buttons 4 and 5 to the org.eclipse.ui.navigate.backwardHistory and *.forwardHistory commands.
Comment 11 Markus Keller CLA 2011-03-31 13:23:15 EDT
Created attachment 192305 [details]
Fix
Comment 12 Paul Webster CLA 2011-04-01 10:04:54 EDT
Released.  Thanx Markus!

PW
Comment 13 Paul Webster CLA 2011-04-26 13:58:45 EDT
I've confirmed the code is there in I20110425-1800, but I have a 3 button mouse.  I'd appreciate it if someone could confirm it's working as expected for them that would be great.

PW
Comment 14 Sergey Prigogin CLA 2011-05-03 15:24:07 EDT
Back mouse button still doesn't work for me on Linux Ubuntu Lucid Lynx.
Comment 15 Sergey Prigogin CLA 2011-05-03 15:28:02 EDT
(In reply to comment #13)
Paul, please give me your postal address so I could send you a 5-button mouse.
Comment 16 Markus Keller CLA 2011-05-04 07:08:53 EDT
Sergey, that sounds like your mouse driver doesn't send button 4 and 5 events when you click those buttons. It works fine on Windows and Mac OS X.

Can you please verify that you get the right events in the ControlExample? Check out org.eclipse.swt.examples from :pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse , run ControlExample, go to the Canvas tab, click Select Listeners, select only MouseDown, check the 'Listen' checkbox, and then press the mouse buttons while the mouse is on the canvas.

If you don't get button=4/5 for the back/forward buttons, then you need to fix the mouse settings in the OS.
Comment 17 Sergey Prigogin CLA 2011-05-04 17:36:28 EDT
(In reply to comment #16)
> Sergey, that sounds like your mouse driver doesn't send button 4 and 5 events
> when you click those buttons. It works fine on Windows and Mac OS X.
> 
> Can you please verify that you get the right events in the ControlExample?
> Check out org.eclipse.swt.examples from
> :pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse , run ControlExample, go to
> the Canvas tab, click Select Listeners, select only MouseDown, check the
> 'Listen' checkbox, and then press the mouse buttons while the mouse is on the
> canvas.
> 
> If you don't get button=4/5 for the back/forward buttons, then you need to fix
> the mouse settings in the OS.

I'm having trouble with the control example in 3.7. The SWT Examples view does not appear in the Show View dialog in spite of the fact that org.eclipse.swt.examples plugin was activated.

Buttons 4 and 5 work fine on my Linux system in all web browsers, but don't work in Eclipse. If somebody of Platform UI committers needs a 5-button mouse for testing, I'm willing to donate it for the cause.
Comment 18 Markus Keller CLA 2011-05-04 21:13:16 EDT
Created attachment 194784 [details]
Fix for Linux

> I'm having trouble with the control example in 3.7.
You can just run the ControlExample class as a Java Application.

I took a look with Ubuntu 10.04 and found that they don't call the mouse buttons 4 and 5 like others, but they use button numbers 8/9 for the fourth and fifth button (back/forward).

The patch adds support for this (but still keeps 4 and 5 working in case other distros use them).
Comment 19 Paul Webster CLA 2011-05-05 07:46:52 EDT
(In reply to comment #18)
> Created attachment 194784 [details]
> Fix for Linux

+1
PW
Comment 20 Markus Keller CLA 2011-05-05 09:23:39 EDT
Released Fix for Linux to HEAD.
Comment 21 Dani Megert CLA 2011-05-05 12:27:56 EDT
> +1
> PW
Paul, can you set the review+ flag so that this bug no longer appears in the query with offending bugs? Thanks.
Comment 22 Paul Webster CLA 2011-05-05 14:53:35 EDT
Done.
PW
Comment 23 Markus Keller CLA 2011-05-17 06:47:14 EDT
Sergey, could you please verify the GTK fix on a recent build (e.g. 3.7RC1)?
Comment 24 Sergey Prigogin CLA 2011-05-18 20:36:01 EDT
(In reply to comment #23)
> Sergey, could you please verify the GTK fix on a recent build (e.g. 3.7RC1)?

Works like charm. Thanks a lot!
Comment 25 Dani Megert CLA 2011-10-06 08:58:54 EDT
Looks like this did not make it into 4.x. Please close if I'm wrong.
Comment 26 Eric Moffatt CLA 2011-12-09 13:09:54 EST
Aggregate move to M5. Retarget to a different milestone if you wish...
Comment 27 Eric Moffatt CLA 2012-02-09 14:22:10 EST
The current implementation of KeybindingService seems to be missing both the old KeyDown, Traverse and MouseDown listeners so this is not just a matter of a missed patch; we have to figure out whether this code still makes sense and where we should install these filters if we want to re-enable this behavior.

NOTE: If we decide to add these we should use the code (essentially) from the R3_development repo as it contains the fixes for this defect as well.
Comment 28 Eric Moffatt CLA 2012-02-09 14:28:42 EST
A quick check shows that the 4.2 KB service is only instantiated once per session so we should be able to simply add this code into an @PostConstruct method...

Paul, did the old 'listener' and 'backForwardListener' provide handling that we want to move forward (I'm interested in what the 'Traverse' handling was since that's generally associated with accessibility support...).
Comment 29 Paul Webster CLA 2012-02-10 08:05:17 EST
(In reply to comment #28)
> 
> Paul, did the old 'listener' and 'backForwardListener' provide handling that we
> want to move forward (I'm interested in what the 'Traverse' handling was since
> that's generally associated with accessibility support...).

In 3.x the BindingService adds all of the filters.  In 4.x the equivalent functionality needs to be added in org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(MApplicationElement, IEclipseContext) and implemented somewhere in org.eclipse.e4.ui.bindings.keys, like KeyBindingDispatcher.

PW
Comment 30 Sergey Prigogin CLA 2012-06-19 14:57:09 EDT
This is a regression, not an enhancement.
Comment 31 Paul Webster CLA 2012-07-04 11:20:31 EDT
*** Bug 384092 has been marked as a duplicate of this bug. ***
Comment 32 Markus Keller CLA 2012-07-10 13:06:47 EDT
Created attachment 218515 [details]
Fix for 4.2.1

(In reply to comment #29)
I tried to implement this, but I failed since IWorkbenchCommandConstants is not accessible from the org.eclipse.e4.ui.workbench.swt bundle.

As a first step, we should just fix the regression for Eclipse users and hardcode the Back/Forward support in the org.eclipse.ui.workbench bundle again.

Bug 47099 is for a more general mouse button handling service.
Comment 34 Markus Keller CLA 2012-07-16 13:35:19 EDT
.
Comment 35 Dani Megert CLA 2012-08-23 06:31:20 EDT
Verified in M20120822-1200.