boolean qt_event_keypress_pp( int widgetHandle, int key, int modifier, int character, int nativeScanCode) { // In QTextEdit key events normally come with QTextEdit handle (=scrollAreaHandle). // KeyPress events may come with viewport widget handle (=handle) when Display.post() // is used to generate the event. In this case just let the event through so that it is // passed to QTextEdit in native side. if (variant == TextUtils.TEXT_EDIT && widgetHandle != scrollAreaHandle) { return false; } if (super.qt_event_keypress_pp(widgetHandle, key, modifier, character, nativeScanCode)) { return true; } if (!(hooks(SWT.Verify) || filters(SWT.Verify)) && textLimit <= 0) { return false; } Event keyEv = makeKeyEvent(key, modifier, character, nativeScanCode); return TextUtils.handle_keypress( variant, widgetHandle, key, modifier, character, keyEv, textLimit, this); }