summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorJiang Jiang <jiang.jiang@nokia.com>2012-01-17 10:29:27 (GMT)
committerQt by Nokia <qt-info@nokia.com>2012-01-17 11:56:35 (GMT)
commita2fb94037bc15ae904d455762b069f4e9434285f (patch)
treea3d86fb69c93fdbda095fdaf52b6d6e497625318 /src/gui
parent330ca76b021d35421a227bd6eaca95653e58bb01 (diff)
downloadQt-a2fb94037bc15ae904d455762b069f4e9434285f.zip
Qt-a2fb94037bc15ae904d455762b069f4e9434285f.tar.gz
Qt-a2fb94037bc15ae904d455762b069f4e9434285f.tar.bz2
Fix CJK punctuation input through input methods in OS X
In this case these string are not input through a composing process (no marked text is set) but they should not be handled by Qt key event handler. Change-Id: I9ea96c29db69d51abc6821e72a3228158012bebc Task-number: QTBUG-23216 Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/kernel/qcocoaview_mac.mm8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/gui/kernel/qcocoaview_mac.mm b/src/gui/kernel/qcocoaview_mac.mm
index 2355cda..84cb03a 100644
--- a/src/gui/kernel/qcocoaview_mac.mm
+++ b/src/gui/kernel/qcocoaview_mac.mm
@@ -1014,7 +1014,13 @@ static int qCocoaViewCount = 0;
// When entering characters through Character Viewer or Keyboard Viewer, the text is passed
// through this insertText method. Since we dont receive a keyDown Event in such cases, the
// composing flag will be false.
- if (([aString length] && composing) || !fromKeyDownEvent) {
+ //
+ // Characters can be sent through input method directly without composing process as well,
+ // for instance a Chinese input method will send "," (U+FF0C) to insertText: when "," key
+ // is pressed. In that case we want to set commit string directly instead of going through
+ // key events handling again. Hence we only leave the string with Unicode value less than
+ // 256 to the key events handling process.
+ if (([aString length] && (composing || commitText.at(0).unicode() > 0xff)) || !fromKeyDownEvent) {
// Send the commit string to the widget.
composing = false;
sendKeyEvents = false;