0

无论我尝试什么,当我添加 addListener(Events.KeyPress, new Listener() { public void handleEvent(FieldEvent e) { changed = true; } });

或者

    addKeyListener(new KeyListener() {
        public void componentKeyDown(ComponentEvent event) {
            changed = true;
        }
    });

没有任何记录...事件未被捕获。有人知道如何使这项工作吗?

谢谢你。柯特

4

1 回答 1

0

目前您必须扩展HtmlEditor和覆盖onEditorKeyDown().

class ExtendedHtmlEditor extends HtmlEditor {

    public ExtendedHtmlEditor() {
        super();
    }

    @Override
    protected void onEditorKeyDown(KeyDownEvent e) {
        super.onEditorKeyDown(e);
        Window.alert("w000t");
    }

}

另请参见此处

于 2010-11-03T06:55:39.383 回答