Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 26873

Summary: [navigation] Should not have to move mouse to get link behaviour
Product: [Eclipse Project] Platform Reporter: Nick Edgar <n.a.edgar>
Component: TextAssignee: Markus Keller <markus.kell.r>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, deepakazad, hudsonr, jwatt, markus.kell.r, overholt, peter
Version: 2.1   
Target Milestone: 4.3 M1   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Patch to fix hyperlink behaviour
none
Patch daniel_megert: review-

Description Nick Edgar CLA 2002-11-21 11:34:33 EST
build I20021115

- move pointer over a declaration
- hold down Ctrl
- click
- it moves the caret


- move pointer over a declaration
- hold down Ctrl
- wiggle mouse
- click
- it opens on the declaration

The first scenario should work the same as the second.  There should be no 
order dependency between holding down Ctrl and moving the mouse.
Several times now I have wanted to open on a declaration and it hasn't worked 
because I moved to the declaration first, then Ctrl+Clicked.

It should be possible to do this using either a key listener to track Ctrl 
down, or get the key modifiers in the mouse click event.
Comment 1 Nick Edgar CLA 2002-11-21 11:35:02 EST
I feel that this is a major usability problem with this feature.
Comment 2 Nick Edgar CLA 2002-11-21 11:36:28 EST
Simply checking for Ctrl in the mouse click event will not suffice.
You want the blue underline to appear when Ctrl is held down before clicking.
Comment 3 Dani Megert CLA 2003-07-23 03:43:42 EDT
*** Bug 40504 has been marked as a duplicate of this bug. ***
Comment 4 Dani Megert CLA 2004-07-01 05:46:00 EDT
*** Bug 31842 has been marked as a duplicate of this bug. ***
Comment 5 Dani Megert CLA 2005-06-16 06:40:58 EDT
We will look into this during 3.2.
Comment 6 Dani Megert CLA 2006-03-27 11:21:21 EST
Sorry, not for 3.2.
Comment 7 Nobody - feel free to take it CLA 2007-09-04 04:27:05 EDT
Created attachment 77623 [details]
Patch to fix hyperlink behaviour
Comment 8 Dani Megert CLA 2007-09-24 09:15:45 EDT
Sorry but the attached patch seems to be corrupted: when applying it says that the file doesn't contain a valid patch. 
Comment 9 Nobody - feel free to take it CLA 2007-09-24 09:35:22 EDT
Hi Daniel, don't know whats happening there. If i click "Details" for the patch it can some me the contents correctly. Double check the download and if it's still corrupt i'll upload again tonight.
Comment 10 Dani Megert CLA 2007-09-24 09:45:42 EDT
Yeah, I can read and download but Team > Apply Patch... gives me an error.
Comment 11 Nobody - feel free to take it CLA 2007-09-24 18:13:32 EDT
Created attachment 79098 [details]
Patch 

Uploaded the patch again Daniel. Hope it works this time...
Comment 12 Dani Megert CLA 2007-09-25 04:09:52 EDT
Sorry but the patch does not work and places the code in the wrong method which is not intended to call showHyperlinks(...).

Test Case 1: test on NLS property keys
Test Case 2: change the modifier key for Java elements to 'Ctrl+Alt'

Also, it deletes commented code. Please don't touch exisiting "code". 

The copyright needs to be updated with your credentials and the bug, e.g.:
Your Name <yourmail.com> - [navigation] Should not have to move mouse to get link behaviour - https://bugs.eclipse.org/bugs/show_bug.cgi?id=26873

Comment 13 Markus Keller CLA 2011-06-29 05:17:39 EDT
(In reply to comment #2)
> Simply checking for Ctrl in the mouse click event will not suffice.
> You want the blue underline to appear when Ctrl is held down before clicking.

The problem with underlining on CtrlDown is that this causes flickering when the mouse is over an identifier and you press an unrelated shortcut. See e.g. bug 25871 comment 7.

The best fix is really to check the modifiers in the mouse click event.
Comment 14 Dani Megert CLA 2012-06-08 05:10:02 EDT
*** Bug 334246 has been marked as a duplicate of this bug. ***
Comment 15 Jonathan Watt CLA 2012-06-08 06:24:46 EDT
*** Bug 380085 has been marked as a duplicate of this bug. ***
Comment 16 Markus Keller CLA 2012-06-08 10:37:52 EDT
Fixed with http://git.eclipse.org/c/platform/eclipse.platform.text.git/commit/?id=03b415b2980f64697216f297f75295c1721d3ceb

The fix shows the hyperlink on MouseDown (not on KeyDown, see comment 13).

It also fixes issues with the Alt key (which at least on Windows does not generate a KeyDown event).
Comment 17 Randy Hudson CLA 2012-06-08 13:47:57 EDT
> It also fixes issues with the Alt key (which at least on Windows does not
> generate a KeyDown event).

Is that with WPF?  I'm pretty sure win32 supported it.  Is there a bug open?
Comment 18 Markus Keller CLA 2012-06-11 07:05:34 EDT
> > It also fixes issues with the Alt key (which at least on Windows does not
> > generate a KeyDown event).

Sorry, the statement in parentheses was wrong. The KeyDown event is fine, but our handling of the KeyDown event was wrong e.g. when Ctrl was held down and then Alt was pressed. We only checked event.keyCode, but missed event.stateMask, which is also relevant in  that situation.

Clarified this and other comments:
http://git.eclipse.org/c/platform/eclipse.platform.text.git/commit/?id=afd2e060874fe5b032acd2f3f664560a44359eb8
Comment 19 Deepak Azad CLA 2012-08-07 03:20:55 EDT
Verified with I20120806-2000 for 4.3 M1