Bug 222571 - VerifyListener makes Shift+Backspace not work in Text
Summary: VerifyListener makes Shift+Backspace not work in Text
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Mohamed El-Kholy CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-13 09:55 EDT by Grant Gayed CLA
Modified: 2019-09-06 16:04 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Grant Gayed CLA 2008-03-13 09:55:59 EDT
- run the snippet at the bottom, note that Shift+Backspace deletes the previous character if a VerifyListener is not hooked, but it does nothing once an empty  VerifyListener has been hooked
- Text.sendKeyEvent(...) contains the following:

{
    ...
    if (!hooks (SWT.Verify) && !filters (SWT.Verify)) return true;
    ...
    if ((stateMask & (SWT.ALT | SWT.SHIFT | SWT.CONTROL)) != 0) return false;
    ...
}

- if there's no VerifyListener hooked then true is returned from here, but if an empty VerifyListener is hooked then it ends up returning false for this case

public static void main(String[] args) {
    final Display display = new Display();
    final Shell shell = new Shell(display);
    shell.setBounds(10,10,200,200);
    shell.setLayout(new FillLayout());
    Text text = new Text(shell, SWT.SINGLE);
//  text.addListener(SWT.Verify, new Listener() {
//      public void handleEvent(Event event) {}
//  });
    shell.open();
    while(!shell.isDisposed()) {
        if(!display.readAndDispatch()) display.sleep();
    }
    display.dispose();
}
Comment 1 Eclipse Webmaster CLA 2019-09-06 16:04:25 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.