src/hbplugins/inputmethods/touchinput/hbinputprediction12keyhandler.cpp
changeset 7 923ff622b8b9
parent 6 c3690ec91ef8
child 21 4633027730f5
child 34 ed14f46c0e55
equal deleted inserted replaced
6:c3690ec91ef8 7:923ff622b8b9
    80     }
    80     }
    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         if (buttonId == HbInputButton::ButtonKeyCodeAsterisk) {
    85         // mode switch should happen only when Qt::Key_Asterisk key is pressed in non-SCT
       
    86         // keypad.			
       
    87         if (buttonId == HbInputButton::ButtonKeyCodeAsterisk &&
       
    88             !mInputMethod->isSctModeActive()) {
    86             //Remove the "?" mark if present
    89             //Remove the "?" mark if present
    87             if (!mCanContinuePrediction) {
    90             if (!mCanContinuePrediction) {
    88                 chopQMarkAndUpdateEditor();
    91                 chopQMarkAndUpdateEditor();
    89             }	
    92             }	
    90             mInputMethod->switchMode(buttonId);
    93             mInputMethod->switchMode(buttonId);
   106             // Delete "?" entered
   109             // Delete "?" entered
   107             if (!mCanContinuePrediction) {
   110             if (!mCanContinuePrediction) {
   108                 deleteOneCharacter();
   111                 deleteOneCharacter();
   109                 mLongPressHappened = true;
   112                 mLongPressHappened = true;
   110             }
   113             }
   111             if (buttonId != HbInputButton::ButtonKeyCodeDelete) {
   114             // commit the first mapped number character when long key press
       
   115             // of character key received in alphanumeric mode						
       
   116             if (buttonId != HbInputButton::ButtonKeyCodeDelete &&
       
   117                 !mInputMethod->isSctModeActive()) {
   112                 q->commitFirstMappedNumber(buttonId, mInputMethod->currentKeyboardType());
   118                 q->commitFirstMappedNumber(buttonId, mInputMethod->currentKeyboardType());
   113                 mLongPressHappened = true;
   119                 mLongPressHappened = true;
   114             }
   120             }
   115         }
   121         }
   116 
   122 
   167     /* Behavior of Short Press of Asterisk Key when in inline editing state 
   173     /* Behavior of Short Press of Asterisk Key when in inline editing state 
   168         - 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
   169         - Should launch Spell Query Dialog if we cannot continue with prediction 
   175         - Should launch Spell Query Dialog if we cannot continue with prediction 
   170     - 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 
   171         - Should launch SCT
   177         - Should launch SCT
       
   178     - Behaviour of Short Press of Asterisk Key in SCT keypad
       
   179         - Should input the * character and should not change the keypad mode			
   172     */
   180     */
   173     else if (buttonId == HbInputButton::ButtonKeyCodeAsterisk ) {
   181     else if (buttonId == HbInputButton::ButtonKeyCodeAsterisk &&
       
   182         !mInputMethod->isSctModeActive()) {
   174         if(!mCanContinuePrediction && (*mCandidates)[mBestGuessLocation].endsWith('?')) {			
   183         if(!mCanContinuePrediction && (*mCandidates)[mBestGuessLocation].endsWith('?')) {			
   175             //Remove the "?" mark
   184             //Remove the "?" mark
   176             (*mCandidates)[mBestGuessLocation].chop(1);
   185             (*mCandidates)[mBestGuessLocation].chop(1);
   177             updateEditor();
   186             updateEditor();
   178             q->launchSpellQueryDialog();
   187             q->launchSpellQueryDialog();