81 |
81 |
82 int buttonId = keyEvent->key(); |
82 int buttonId = keyEvent->key(); |
83 |
83 |
84 if (keyEvent->isAutoRepeat() && mLastKey == buttonId) { |
84 if (keyEvent->isAutoRepeat() && mLastKey == buttonId) { |
85 // mode switch should happen only when Qt::Key_Asterisk key is pressed in non-SCT |
85 // mode switch should happen only when Qt::Key_Asterisk key is pressed in non-SCT |
86 // keypad. |
86 // keypad. |
87 if (buttonId == HbInputButton::ButtonKeyCodeAsterisk && |
87 if (buttonId == HbInputButton::ButtonKeyCodeAsterisk && |
88 !mInputMethod->isSctModeActive()) { |
88 !mInputMethod->isSctModeActive()) { |
89 //Remove the "?" mark if present |
89 //Remove the "?" mark if present |
90 if (!mCanContinuePrediction) { |
90 if (!mCanContinuePrediction) { |
91 chopQMarkAndUpdateEditor(); |
91 chopQMarkAndUpdateEditor(); |
92 } |
92 } |
93 mInputMethod->switchMode(buttonId); |
93 mInputMethod->switchMode(buttonId); |
94 mLongPressHappened = true; |
94 mLongPressHappened = true; |
95 } else if (buttonId == HbInputButton::ButtonKeyCodeShift) { |
95 } else if (buttonId == HbInputButton::ButtonKeyCodeShift) { |
96 mInputMethod->switchMode(HbInputButton::ButtonKeyCodeShift); |
96 mInputMethod->switchMode(HbInputButton::ButtonKeyCodeShift); |
97 mLongPressHappened = true; |
97 mLongPressHappened = true; |
110 if (!mCanContinuePrediction) { |
110 if (!mCanContinuePrediction) { |
111 deleteOneCharacter(); |
111 deleteOneCharacter(); |
112 mLongPressHappened = true; |
112 mLongPressHappened = true; |
113 } |
113 } |
114 // commit the first mapped number character when long key press |
114 // commit the first mapped number character when long key press |
115 // of character key received in alphanumeric mode |
115 // of character key received in alphanumeric mode |
116 if (buttonId != HbInputButton::ButtonKeyCodeDelete && |
116 if (buttonId != HbInputButton::ButtonKeyCodeDelete && |
117 !mInputMethod->isSctModeActive()) { |
117 !mInputMethod->isSctModeActive()) { |
118 q->commitFirstMappedNumber(buttonId, mInputMethod->currentKeyboardType()); |
118 q->commitFirstMappedNumber(buttonId, mInputMethod->currentKeyboardType()); |
119 mLongPressHappened = true; |
119 mLongPressHappened = true; |
120 } |
120 } |
154 |
154 |
155 // since button is released we can set buttonDown back to false. |
155 // since button is released we can set buttonDown back to false. |
156 mButtonDown = false; |
156 mButtonDown = false; |
157 int buttonId = keyEvent->key(); |
157 int buttonId = keyEvent->key(); |
158 |
158 |
159 // short key press of character keys should not be handled when "?" is displayed |
159 // short key press of character keys should not be handled when "?" is displayed |
160 if (!mCanContinuePrediction && !mLongPressHappened && |
160 if (!mCanContinuePrediction && !mLongPressHappened && |
161 buttonId >= Qt::Key_1 && buttonId <= Qt::Key_9) { |
161 buttonId >= Qt::Key_1 && buttonId <= Qt::Key_9) { |
162 return false; |
162 return false; |
163 } |
163 } |
164 // Sym key is handled in this class it self, so not passing it to |
164 // Sym key is handled in this class it self, so not passing it to |
165 // the base mode handlers. |
165 // the base mode handlers. |
166 if (buttonId == HbInputButton::ButtonKeyCodeSymbol || |
166 if (buttonId == HbInputButton::ButtonKeyCodeSymbol || |
167 buttonId == HbInputButton::ButtonKeyCodeAlphabet) { |
167 buttonId == HbInputButton::ButtonKeyCodeAlphabet) { |
168 //Remove the "?" mark if present |
168 //Remove the "?" mark if present |
169 chopQMarkAndUpdateEditor(); |
169 chopQMarkAndUpdateEditor(); |
170 mInputMethod->switchMode(buttonId); |
170 mInputMethod->switchMode(buttonId); |
174 - Should launch Candidate List if we can continue with prediction i.e. "?" is not displayed |
174 - Should launch Candidate List if we can continue with prediction i.e. "?" is not displayed |
175 - Should launch Spell Query Dialog if we cannot continue with prediction |
175 - Should launch Spell Query Dialog if we cannot continue with prediction |
176 - Behavior of Short Press of Asterisk Key when not in inline editing state |
176 - Behavior of Short Press of Asterisk Key when not in inline editing state |
177 - Should launch SCT |
177 - Should launch SCT |
178 - Behaviour of Short Press of Asterisk Key in SCT keypad |
178 - Behaviour of Short Press of Asterisk Key in SCT keypad |
179 - Should input the * character and should not change the keypad mode |
179 - Should input the * character and should not change the keypad mode |
180 */ |
180 */ |
181 else if (buttonId == HbInputButton::ButtonKeyCodeAsterisk && |
181 else if (buttonId == HbInputButton::ButtonKeyCodeAsterisk && |
182 !mInputMethod->isSctModeActive()) { |
182 !mInputMethod->isSctModeActive()) { |
183 if(!mCanContinuePrediction && (*mCandidates)[mBestGuessLocation].endsWith('?')) { |
183 if(!mCanContinuePrediction && (*mCandidates)[mBestGuessLocation].endsWith('?')) { |
184 //Remove the "?" mark |
184 //Remove the "?" mark |
185 (*mCandidates)[mBestGuessLocation].chop(1); |
185 (*mCandidates)[mBestGuessLocation].chop(1); |
186 updateEditor(); |
186 updateEditor(); |
187 q->launchSpellQueryDialog(); |
187 q->launchSpellQueryDialog(); |
188 } else { |
188 } else { |
199 if (mShiftKeyDoubleTap) { |
199 if (mShiftKeyDoubleTap) { |
200 mTimer->stop(); |
200 mTimer->stop(); |
201 mShiftKeyDoubleTap = false; |
201 mShiftKeyDoubleTap = false; |
202 //mShowTail = false; |
202 //mShowTail = false; |
203 if (HbInputSettingProxy::instance()->globalInputLanguage()== mInputMethod->inputState().language()) { |
203 if (HbInputSettingProxy::instance()->globalInputLanguage()== mInputMethod->inputState().language()) { |
204 // in latin variants , double tap of shift key toggles the prediction status |
204 // in latin variants , double tap of shift key toggles the prediction status |
205 // revert back to the old case as this is a double tap |
205 // revert back to the old case as this is a double tap |
206 // (the case was changed on the single tap) |
206 // (the case was changed on the single tap) |
207 updateTextCase(); |
207 updateTextCase(); |
208 q->togglePrediction(); |
208 q->togglePrediction(); |
209 } else { |
209 } else { |
283 //any meaningful word for the input sequence. |
283 //any meaningful word for the input sequence. |
284 if(!d->mCanContinuePrediction) { |
284 if(!d->mCanContinuePrediction) { |
285 int eventKey = event->key(); |
285 int eventKey = event->key(); |
286 switch(eventKey) { |
286 switch(eventKey) { |
287 case Qt::Key_0: |
287 case Qt::Key_0: |
|
288 case HbInputButton::ButtonKeyCodeSettings: |
288 case HbInputButton::ButtonKeyCodeSpace: { |
289 case HbInputButton::ButtonKeyCodeSpace: { |
289 if(d->mCandidates->size() && focusObject) { |
290 if(d->mCandidates->size() && focusObject) { |
290 //Remove the "?" mark |
291 //Remove the "?" mark |
291 (*d->mCandidates)[d->mBestGuessLocation].chop(1); |
292 (*d->mCandidates)[d->mBestGuessLocation].chop(1); |
292 d->updateEditor(); |
293 d->updateEditor(); |