From 6b61a2787759673f246493453c0809d24c9d6ae5 Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Fri, 6 Aug 2010 10:56:44 +0100 Subject: Make input methods work correctly with Symbian^3 FEP in numeric mode Enable alphanumeric modes to use EAknEditorFlagUseSCTNumericCharmap flag so that all symbols are shown when you press the * key when the FEP is in portrait mode (traditional 4x3 mobile phone keypad emulation) Enable text input mode as well as numeric input mode for ImhFormattedNumbersOnly or ImhDialableCharactersOnly, as the '*' key on the virtual keypad does not work to launch the symbols menu otherwise. Task-number: QT-3681 Reviewed-by: Jason Barron --- src/gui/inputmethod/qcoefepinputcontext_s60.cpp | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp index 999edda..cd05e38 100644 --- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp +++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp @@ -359,10 +359,10 @@ void QCoeFepInputContext::applyHints(Qt::InputMethodHints hints) commitTemporaryPreeditString(); - bool numbersOnly = hints & ImhDigitsOnly || hints & ImhFormattedNumbersOnly - || hints & ImhDialableCharactersOnly; - bool noOnlys = !(numbersOnly || hints & ImhUppercaseOnly - || hints & ImhLowercaseOnly); + bool numbersOnly = (hints & ImhDigitsOnly) || (hints & ImhFormattedNumbersOnly) + || (hints & ImhDialableCharactersOnly); + bool noOnlys = !(numbersOnly || (hints & ImhUppercaseOnly) + || (hints & ImhLowercaseOnly)); TInt flags; Qt::InputMethodHints oldHints = hints; @@ -388,8 +388,7 @@ void QCoeFepInputContext::applyHints(Qt::InputMethodHints hints) hints |= ImhPreferLowercase; } else if (hints & ImhUppercaseOnly) { hints |= ImhPreferUppercase; - } else if (hints & ImhDigitsOnly || hints & ImhFormattedNumbersOnly - || hints & ImhDialableCharactersOnly) { + } else if (numbersOnly) { hints |= ImhPreferNumbers; } } @@ -406,6 +405,11 @@ void QCoeFepInputContext::applyHints(Qt::InputMethodHints hints) if (numbersOnly) { flags |= EAknEditorNumericInputMode; } + if (QSysInfo::s60Version() > QSysInfo::SV_S60_5_0 + && ((hints & ImhFormattedNumbersOnly) || (hints & ImhDialableCharactersOnly)) { + //workaround - the * key does not launch the symbols menu, making it impossible to use these modes unless text mode is enabled. + flags |= EAknEditorTextInputMode; + } if (hints & ImhUppercaseOnly || hints & ImhLowercaseOnly) { flags |= EAknEditorTextInputMode; } @@ -456,6 +460,9 @@ void QCoeFepInputContext::applyHints(Qt::InputMethodHints hints) if (hints & ImhNoPredictiveText || hints & ImhHiddenText) { flags |= EAknEditorFlagNoT9; } + // if alphanumeric input, then make all symbols available in numeric mode too. + if (!numbersOnly) + flags |= EAknEditorFlagUseSCTNumericCharmap; m_fepState->SetFlags(flags); ReportAknEdStateEvent(MAknEdStateObserver::EAknEdwinStateFlagsUpdate); -- cgit v0.12