--- a/textinput/ptienginev2/src/Ptiqwertykeymappings.cpp Wed Sep 01 12:23:33 2010 +0100
+++ b/textinput/ptienginev2/src/Ptiqwertykeymappings.cpp Tue Sep 14 21:59:06 2010 +0300
@@ -80,6 +80,7 @@
{
EPtiKeyQwertyS, EPtiKeyQwertyF, EPtiKeyQwertyR, EPtiKeyQwertyX, EPtiKeyQwertyJ
};
+const TUint16 KShortCombine = 0xF010;
//
@@ -540,6 +541,23 @@
//
TUint16 CPtiQwertyKeyMappings::GetCharForMode(TPtiEngineInputMode aMode, TPtrC aChars, TBool aSkipFirst)
{
+ if( DoesModeCharMatchToInputMode(KPtiPinyinMarker, aMode) ||
+ DoesModeCharMatchToInputMode(KPtiStrokeMarker, aMode) ||
+ DoesModeCharMatchToInputMode(KPtiZhuyinMarker, aMode) ||
+ DoesModeCharMatchToInputMode(KPtiCangjieMarker, aMode))
+ {
+ for (TInt i = 0; i < aChars.Length(); i++)
+ {
+ if (DoesModeCharMatchToInputMode(aChars[i], aMode))
+ {
+ if (i + 1 >= aChars.Length())
+ {
+ return 0;
+ }
+ return aChars[i + 1];
+ }
+ }
+ }
for (TInt i = 0; i < aChars.Length(); i++)
{
if (!IsModeControlChar(aChars[i]))
@@ -549,15 +567,14 @@
iCurrentChar++;
continue;
}
+ if(aChars[i] != KShortCombine)
+ {
return aChars[i];
}
- if (DoesModeCharMatchToInputMode(aChars[i], aMode))
- {
- if (i + 1 >= aChars.Length())
+ else
{
return 0;
}
- return aChars[i + 1];
}
i++; // Wrong mode, skip char
}
@@ -604,7 +621,13 @@
if (key != EPtiKeyNone)
{
TPtrC keyData = DataForKeyLocal(key, textCase, EPtiEngineQwerty);
- if (keyData.Locate(aChar) != KErrNotFound)
+ TInt indexOfSpecialMark = keyData.Locate(KShortCombine);
+ TInt indexOfChar = keyData.Locate(aChar);
+ if (indexOfSpecialMark != KErrNotFound && indexOfChar != KErrNotFound && indexOfChar > indexOfSpecialMark)
+ {
+ continue;
+ }
+ else if ( indexOfChar != KErrNotFound)
{
return key;
}