Bug 391350 - Binding DEL to a command breaks DEL in Text widget.
Summary: Binding DEL to a command breaks DEL in Text widget.
Status: ASSIGNED
Alias: None
Product: RAP
Classification: RT
Component: Workbench (show other bugs)
Version: 1.5   Edit
Hardware: All All
: P3 normal with 4 votes (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 394071 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-10-08 08:27 EDT by Markus Krüger CLA
Modified: 2021-02-21 15:09 EST (History)
2 users (show)

See Also:


Attachments
The app with the bug. (14.78 KB, application/x-zip-compressed)
2012-10-08 08:27 EDT, Markus Krüger CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Krüger CLA 2012-10-08 08:27:14 EDT
Created attachment 222020 [details]
The app with the bug.

If you have a view with a treeviewer/tableviewer and a text widget, than a command that is binded to the DEL key disables the DEL key in the text widget.

In my example a DeleteCommand is bind to DEL and there is a view with a huge text widget. If you type text there and select it you can not delete it anymore by pressing DEL.
Comment 1 Ivan Furnadjiev CLA 2012-10-09 06:28:01 EDT
This bug is similar to bug 348559, but not the same. When workbench key-binding mechanism (extension point) is used, all bindings is added both to the display ACTIVE_KEYS and CANCEL_KEYS lists (see org.eclipse.jface.bindings.BindingManager.updateKeyBindingList()). In RCP the DEL and ESC keys are so called out-of-order keys (see org.eclipse.ui.internal.keys.WorkbenchKeyboard.outOfOrderKeys), which are treated differently. Unfortunately, out-of-order keys are not supported in RAP.
The solution will be to follow bug 54654 comment#4 - "Text widgets no longer accept "DEL" as a key binding; they will only direct "DEL" to the widget itself."
Comment 2 Ivan Furnadjiev CLA 2012-11-12 03:15:43 EST
*** Bug 394071 has been marked as a duplicate of this bug. ***
Comment 3 Ivan Furnadjiev CLA 2014-05-07 08:42:09 EDT
We could remove the DEL key from CANCEL_KEYS lists in org.eclipse.jface.bindings.BindingManager.updateKeyBindingList() and enable WorkbenchKeyboard# isOutOfOrderKey() code for DEL. With this approach the default behavior on the client for DEL will not be suppressed and DEL key binding will not be triggered if DEL is pressed on Text and Combo (see WorkbenchKeyboard#filterKeySequenceBindings).
Comment 4 Markus Krüger CLA 2014-05-07 17:46:38 EDT
Not only the DEL key is affected. Also Ctrl+V and other key bindings used by commands.
Comment 5 Tim Buschtoens CLA 2014-05-08 04:15:15 EDT
(In reply to Markus Krüger from comment #4)
> Not only the DEL key is affected. Also Ctrl+V and other key bindings used by
> commands.

Yes, that is to be expected. However, as far as I can tell the same would happen in RCP, since those keys don't get any kind of special treatment. I have been wondering why DEL is the only exception, but I guess bindings on backspace or arrow keys (without modifier) are more unusual.
Comment 6 Markus Krüger CLA 2014-05-08 05:17:25 EDT
Nope, our application is single sourced and the RCP version is working.
Comment 7 Tim Buschtoens CLA 2014-05-08 09:29:53 EDT
I think the most feasable solution would be to no longer allow text-editing keys/shortcuts to be canceled white text-fields are focused. I'm not 100% sure yet how to implement it, and it's not entirely trivial since there are different combinations on different OS. Overall it shouldn't be more than two days or so. However, since this is a change in existing behavior it won't be part of the 2.3 release, just 3.0.