61 |
61 |
62 int index = mNumChr; |
62 int index = mNumChr; |
63 do { |
63 do { |
64 int currCharIndex = 0; |
64 int currCharIndex = 0; |
65 mCurrentChar = 0; |
65 mCurrentChar = 0; |
66 //This condition is to avoid get the characters mapped to Asterisk |
66 //This condition is to avoid get the characters mapped to Asterisk |
67 //Especially for Thai language we have mapped character to Asterisk |
67 //Especially for Thai language we have mapped character to Asterisk |
68 if (buttonId != HbInputButton::ButtonKeyCodeAsterisk || |
68 if (buttonId != HbInputButton::ButtonKeyCodeAsterisk || |
69 mInputMethod->currentKeyboardType() == HbKeyboardSctEmail || |
69 mInputMethod->currentKeyboardType() == HbKeyboardSctEmail || |
70 mInputMethod->currentKeyboardType() == HbKeyboardSctUrl || |
70 mInputMethod->currentKeyboardType() == HbKeyboardSctUrl || |
71 mInputMethod->currentKeyboardType() == HbKeyboardSctPortrait ) { |
71 mInputMethod->currentKeyboardType() == HbKeyboardSctPortrait ) { |
72 currCharIndex = mNumChr ; |
72 currCharIndex = mNumChr ; |
73 mCurrentChar = q->getNthCharacterInKey(mNumChr, buttonId, type); |
73 mCurrentChar = q->getNthCharacterInKey(mNumChr, buttonId, type); |
74 } |
74 } |
75 |
75 |
76 if (mCurrentChar != 0) { |
76 if (mCurrentChar != 0) { |
77 if (focusObject->characterAllowedInEditor(mCurrentChar)) { |
77 if (focusObject->characterAllowedInEditor(mCurrentChar)) { |
78 //If the keypad is SCT or button has only one character that is allowed to editor, |
78 //If the keypad is SCT or button has only one character that is allowed to editor, |
79 //we can commit the character immidiately |
79 //we can commit the character immidiately |
113 } else if (mDownKey == HbInputButton::ButtonKeyCodeSymbol && |
113 } else if (mDownKey == HbInputButton::ButtonKeyCodeSymbol && |
114 (mInputMethod->currentKeyboardType() != HbKeyboardSctPortrait && |
114 (mInputMethod->currentKeyboardType() != HbKeyboardSctPortrait && |
115 mInputMethod->currentKeyboardType() != HbKeyboardSctEmail && |
115 mInputMethod->currentKeyboardType() != HbKeyboardSctEmail && |
116 mInputMethod->currentKeyboardType() != HbKeyboardSctUrl )) { |
116 mInputMethod->currentKeyboardType() != HbKeyboardSctUrl )) { |
117 mLongPressHappened = true; |
117 mLongPressHappened = true; |
118 mInputMethod->selectSpecialCharacterTableMode(); |
118 if (HbInputSettingProxy::instance()->globalInputLanguage().language() == QLocale::Chinese) { |
|
119 mInputMethod->switchMode(mDownKey); |
|
120 } else { |
|
121 mInputMethod->selectSpecialCharacterTableMode(); |
|
122 } |
119 } else if (mDownKey == HbInputButton::ButtonKeyCodeAsterisk && |
123 } else if (mDownKey == HbInputButton::ButtonKeyCodeAsterisk && |
120 !mInputMethod->isSctModeActive() && |
124 !mInputMethod->isSctModeActive() && |
121 (mInputMethod->currentKeyboardType() != HbKeyboardSctPortrait && |
125 (mInputMethod->currentKeyboardType() != HbKeyboardSctPortrait && |
122 mInputMethod->currentKeyboardType() != HbKeyboardSctUrl && |
126 mInputMethod->currentKeyboardType() != HbKeyboardSctUrl && |
123 mInputMethod->currentKeyboardType() != HbKeyboardSctEmail )) { |
127 mInputMethod->currentKeyboardType() != HbKeyboardSctEmail )) { |
124 // launch the SCT keypad when long press of Asterisk key is |
128 // launch the SCT keypad when long press of Asterisk key is |
125 // received in non-SCT mode |
129 // received in non-SCT mode |
126 mLongPressHappened = true; |
130 mLongPressHappened = true; |
127 mInputMethod->switchMode(mDownKey); |
131 mInputMethod->switchMode(mDownKey); |
128 } else if (mDownKey != HbInputButton::ButtonKeyCodeDelete && |
132 } else if (mDownKey != HbInputButton::ButtonKeyCodeDelete && |
129 mInputMethod->currentKeyboardType() != HbKeyboardSctPortrait) { |
133 mInputMethod->currentKeyboardType() != HbKeyboardSctPortrait) { |
130 mLongPressHappened = true; |
134 mLongPressHappened = true; |
226 mShiftKeyDoubleTapped = false; |
230 mShiftKeyDoubleTapped = false; |
227 mTimer->stop(); |
231 mTimer->stop(); |
228 if( HbInputSettingProxy::instance()->globalInputLanguage() == mInputMethod->inputState().language() || |
232 if( HbInputSettingProxy::instance()->globalInputLanguage() == mInputMethod->inputState().language() || |
229 HbInputSettingProxy::instance()->globalSecondaryInputLanguage() == mInputMethod->inputState().language() || |
233 HbInputSettingProxy::instance()->globalSecondaryInputLanguage() == mInputMethod->inputState().language() || |
230 ((HbEditorConstraintLatinAlphabetOnly | HbEditorConstraintAutoCompletingField)==focusObject->editorInterface().inputConstraints())){ |
234 ((HbEditorConstraintLatinAlphabetOnly | HbEditorConstraintAutoCompletingField)==focusObject->editorInterface().inputConstraints())){ |
231 // in latin variants , double tap of shift key toggles the prediction status |
235 // in latin variants , double tap of shift key toggles the prediction status |
232 // revert back to the old case as this is a double tap |
236 // revert back to the old case as this is a double tap |
233 // (the case was changed on the single tap) |
237 // (the case was changed on the single tap) |
234 updateTextCase(); |
238 updateTextCase(); |
235 // when the language does not support prediction in that case we should not update the state and prediction |
239 // when the language does not support prediction in that case we should not update the state and prediction |
236 if(HbPredictionFactory::instance()->predictionEngineForLanguage(mInputMethod->inputState().language()) && |
240 if(HbPredictionFactory::instance()->predictionEngineForLanguage(mInputMethod->inputState().language()) && |
269 // it was a long press on sct swith button. so just return form here. |
273 // it was a long press on sct swith button. so just return form here. |
270 if (!mTimer->isActive() && buttonId == HbInputButton::ButtonKeyCodeSymbol) { |
274 if (!mTimer->isActive() && buttonId == HbInputButton::ButtonKeyCodeSymbol) { |
271 return true; |
275 return true; |
272 } |
276 } |
273 // switch the keypad mode when the short key press of Asterisk key in non-SCT mode |
277 // switch the keypad mode when the short key press of Asterisk key in non-SCT mode |
274 // or SYM button or Alphabet button is received |
278 // or SYM button or Alphabet button is received |
275 if ((buttonId == HbInputButton::ButtonKeyCodeAsterisk && |
279 if ((buttonId == HbInputButton::ButtonKeyCodeAsterisk && |
276 !mInputMethod->isSctModeActive()) || buttonId == HbInputButton::ButtonKeyCodeSymbol || |
280 !mInputMethod->isSctModeActive()) || buttonId == HbInputButton::ButtonKeyCodeSymbol || |
277 buttonId == HbInputButton::ButtonKeyCodeAlphabet) { |
281 buttonId == HbInputButton::ButtonKeyCodeAlphabet) { |
278 mInputMethod->switchMode(buttonId); |
282 mInputMethod->switchMode(buttonId); |
279 return true; |
283 return true; |