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

Bug 42225

Summary: Can't assign command to Ctrl+Backspace
Product: [Eclipse Project] Platform Reporter: Dani Megert <daniel_megert>
Component: SWTAssignee: Steve Northover <snorthov>
Status: RESOLVED FIXED QA Contact:
Severity: critical    
Priority: P3 CC: csmclaren, douglas.pollock, eclipse.sprigogin, jcompagner, Jon.Rabone, kai-uwe_maetzel, Kelsey.grant, kwester, lbreisacher, nikolaymetchev, oyvind.harboe, spaced, tonny.madsen, wizardofbeans
Version: 3.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on:    
Bug Blocks: 43140    
Attachments:
Description Flags
Patch for KeySupport
none
convertEventToAccelerator.java
none
Patch to KeySupport none

Description Dani Megert CLA 2003-08-28 11:51:35 EDT
I20030827

Out of the box Ctrl+Backspace should delete the previous word. Somehow the key
binding manager thinks this is Ctrl+Del and deletes the next word.

If I try to reassing the key via key pref page it displays Ctrl+Del when I press
Ctrl+Backspace.

I have a Swiss German Keyboard using Swiss German Locale.
Comment 1 Lee Breisacher CLA 2003-08-29 00:02:11 EDT
I'm seeing the same thing. I'm on WinXP Pro. I have build 200308281813. 
Comment 2 Lee Breisacher CLA 2003-08-29 00:02:58 EDT
Oh, and I have an ordinary US keyboard.
Comment 3 Nikolay Metchev CLA 2003-09-01 08:14:00 EDT
some here. Windows 2000 and normal UK keyboard.
Comment 4 Nikolay Metchev CLA 2003-09-02 07:39:31 EDT
oh and Ctrl+Enter seems to be thought of as Ctrl+J
Comment 5 Nikolay Metchev CLA 2003-09-02 08:42:18 EDT
Eclipse seems to override the default locale for the JVM when I run the 
following code:
--------------------
package a;

import java.util.Locale;

public class A
{
   public static void main(String[] args)
   {
      System.out.println(Locale.getDefault());
   }
}

--------------------------
I always get en_US despite my locale being en_GB
Comment 6 Douglas Pollock CLA 2003-09-04 15:05:30 EDT
The locale problem is not related.  Please file a separate bug.

The problem is that key events from SWT appear differently on Windows XP and
Linux-GTK.  For example, "Ctrl+Backspace" on the two systems is:

Windows XP - keyCode=0x08, character=0x7F DEL
Linux-GTK  - keyCode=0x08, character=0x08 '\b'

And "Ctrl+Enter" is:

Windows XP - keyCode=0x0D, character=0x0A '\n'
Linux-GTK  - keyCode=0x0D, character=0x0D '\r'
Comment 7 Douglas Pollock CLA 2003-09-04 15:48:57 EDT
Created attachment 5996 [details]
Patch for KeySupport

This still needs testing on Linux-GTK.	It appears to work for every key
combination I can dream up on Windows XP.  The patch is meant to be applied to
KeySupport in the org.eclipse.ui.workbench project.
Comment 8 Douglas Pollock CLA 2003-09-04 16:05:49 EDT
It looks good on Linux-GTK.

Unexpected behaviour can still be seen on the following key strokes:
- "Ctrl+Break" sends "Ctrl+C" twice on Windows XP.
- "Ctrl+Enter" (using the enter on the right keypad) sends 0x00 and 0x00 on
Linux-GTK.
- "Ctrl+Shift+2" sends 0x00 and 0x00 on Windows XP (and Linux-GTK, as long as
it's not on an entry widget -- see Bug 42009)
Comment 9 Douglas Pollock CLA 2003-09-04 16:07:38 EDT
chris: review/apply.
Comment 10 Chris McLaren CLA 2003-09-05 09:04:10 EDT
doug your patch looks good, though i fear we are making amends at our level 
for mistakes in swt. before we commit anything, i want to move this bug to 
steve northover. 

steve: i am attaching a wad for you, a single static method to convert an SWT 
event to an SWT accelerator representation. you can see doug has done some 
extra mangling here. can you confirm that the difference between platforms is 
intentional?

furthermore, swt does not support the num-pad-enter key, any reason why?
Comment 11 Chris McLaren CLA 2003-09-05 09:05:20 EDT
Created attachment 5999 [details]
convertEventToAccelerator.java
Comment 12 Douglas Pollock CLA 2003-09-05 09:19:34 EDT
*** Bug 42358 has been marked as a duplicate of this bug. ***
Comment 13 Dani Megert CLA 2003-09-08 10:20:43 EDT
*** Bug 42547 has been marked as a duplicate of this bug. ***
Comment 14 Tom Hofmann CLA 2003-09-10 02:47:57 EDT
*** Bug 42756 has been marked as a duplicate of this bug. ***
Comment 15 Kurt Westerfeld CLA 2003-09-10 14:16:05 EDT
*** Bug 42890 has been marked as a duplicate of this bug. ***
Comment 16 Debbie Wilson CLA 2003-09-11 09:57:33 EDT
*** Bug 42932 has been marked as a duplicate of this bug. ***
Comment 17 Chris McLaren CLA 2003-09-11 11:01:06 EDT
moving to critical because of all the dups. and the nice, fat cc: list as 
well..
Comment 18 Douglas Pollock CLA 2003-09-12 11:03:50 EDT
*** Bug 43002 has been marked as a duplicate of this bug. ***
Comment 19 Douglas Pollock CLA 2003-09-12 11:05:01 EDT
Created attachment 6089 [details]
Patch to KeySupport

More hacking to fix the additional problem seen in 43002.  Events of the
SWT.Traverse type have different properties with the SWT.CTRL state mask than
those with the SWT.KeyDown type.
Comment 20 Douglas Pollock CLA 2003-09-12 11:11:03 EDT
Note: this bug seems to be a duplicate of 9794.  Events are giving inconsistent
character and keyCode between operating systems and between event types.

From Bug 43002, on "Ctrl+Tab":
key down - character=0x09, keyCode=0x09
traverse - character=0x09, keyCode=0x00
Comment 21 Douglas Pollock CLA 2003-09-12 12:42:14 EDT
Comment on attachment 5996 [details]
Patch for KeySupport

The newer patch supercedes this one.
Comment 22 Douglas Pollock CLA 2003-09-12 12:48:47 EDT
*** Bug 42802 has been marked as a duplicate of this bug. ***
Comment 23 Douglas Pollock CLA 2003-09-12 12:50:03 EDT
While verifying the fix, make sure that "Ctrl+Return" and "Ctrl+M" are viewed
differently by KeySupport (Bug 42802).
Comment 24 Johan Compagner CLA 2003-09-23 04:30:52 EDT
It is not just that CTRL-M is also mapped to CTRL-ENTER
Because if i remove CTRL-M as the maximize editor (map it to CTRL-SHIFT-N or 
something like that)
Then suddenly CTRL-ENTER is Incremental Find!!!

Comment 25 Douglas Pollock CLA 2003-09-23 09:06:57 EDT
I've seen Ctrl+Enter get mapped to Ctrl+J, Ctrl+M or Ctrl+Enter -- depending 
on build.  It depends which version of KeySupport you have, your locale, and 
your operating environment (i.e., platform, operating system, etc.)
Comment 26 Johan Compagner CLA 2003-09-23 09:20:07 EDT
My Ibuild: 20030917

My locale settings:

user.country=NL
user.language=nl
user.timezone=Europe/Berlin
user.variant=

But remember:
In this configuration CTRL-Enter was first mapped to CTRL-M but when i removed 
that CTRL-M it suddenly mapped to CTRL-J (which is java editor specific)

If i also remap that one (CTRL-J to CTRL-[) CTRL-ENTER finally doesn't do 
anything at default..
Comment 27 Douglas Pollock CLA 2003-09-23 09:57:58 EDT
Can you comment re: Bug 42035?  Are the key code and character values now
consistent across operating systems?  Thanks.
Comment 28 Steve Northover CLA 2003-09-23 11:48:57 EDT
Working on it.  Despite the fact that this is "correct Windows platform 
behavior", it's also not portable.  I'm looking into fixing Windows.
Comment 29 Steve Northover CLA 2003-09-23 12:29:07 EDT
Fixed > 20030923
Comment 30 Douglas Pollock CLA 2003-09-23 13:58:50 EDT
*** Bug 43140 has been marked as a duplicate of this bug. ***
Comment 31 Debbie Wilson CLA 2003-09-29 12:08:52 EDT
*** Bug 43785 has been marked as a duplicate of this bug. ***
Comment 32 Dani Megert CLA 2003-10-06 04:46:34 EDT
*** Bug 44114 has been marked as a duplicate of this bug. ***