From 51ff257a5cd423469770b3f1eae8b350ffb8ae8b Mon Sep 17 00:00:00 2001 From: Prasanth Ullattil Date: Fri, 23 Apr 2010 10:31:39 +0200 Subject: Diacritic input broken, duplicate the base glypha (on Mac OS X carbon) This was a regression introduced by 8da880e77db04c. The saved key event needs to be cleared if we process a valid raw key event. Task-number: QTBUG-7099 Reviewed-by: Richard Moe Gustavsen (cherry picked from commit e30e3bb524536ef0f6b55272901b24bbbd4dfbd6) --- src/gui/kernel/qkeymapper_mac.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/gui/kernel/qkeymapper_mac.cpp b/src/gui/kernel/qkeymapper_mac.cpp index fe950fd..e3bd466 100644 --- a/src/gui/kernel/qkeymapper_mac.cpp +++ b/src/gui/kernel/qkeymapper_mac.cpp @@ -717,14 +717,23 @@ bool QKeyMapperPrivate::translateKeyEvent(QWidget *widget, EventHandlerCallRef e return true; } - if (qApp->inputContext() && qApp->inputContext()->isComposing()) { + QInputContext *currentContext = qApp->inputContext(); + if (currentContext && currentContext->isComposing()) { if (ekind == kEventRawKeyDown) { - QMacInputContext *context = qobject_cast(qApp->inputContext()); + QMacInputContext *context = qobject_cast(currentContext); if (context) context->setLastKeydownEvent(event); } return false; } + // Once we process the key down , we dont need to send the saved event again from + // kEventTextInputUnicodeForKeyEvent, so clear it. + if (currentContext && ekind == kEventRawKeyDown) { + QMacInputContext *context = qobject_cast(currentContext); + if (context) + context->setLastKeydownEvent(0); + } + //get modifiers Qt::KeyboardModifiers modifiers; int qtKey; -- cgit v0.12