Bug 222571

Summary: VerifyListener makes Shift+Backspace not work in Text
Product: [Eclipse Project] Platform Reporter: Grant Gayed <grant_gayed>
Component: SWTAssignee: Mohamed El-Kholy <khouly>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3 CC: Silenio_Quarti
Version: 3.4   
Target Milestone: ---   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

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.