diff options
author | Thierry Bastian <thierry.bastian@nokia.com> | 2011-03-10 13:43:22 (GMT) |
---|---|---|
committer | Thierry Bastian <thierry.bastian@nokia.com> | 2011-03-10 13:43:22 (GMT) |
commit | 306d16002220b99ad386fb1255034b94861a8c9f (patch) | |
tree | 1da1a91756e396e134173caeb4772f3f466033a4 /src/gui/kernel/qkeymapper_s60.cpp | |
parent | f82f128451ef78e968c85944af10e0e54dbb73c5 (diff) | |
parent | 5c36cc0ba648d5efa7592e86d49b23086cdbb8ff (diff) | |
download | Qt-306d16002220b99ad386fb1255034b94861a8c9f.zip Qt-306d16002220b99ad386fb1255034b94861a8c9f.tar.gz Qt-306d16002220b99ad386fb1255034b94861a8c9f.tar.bz2 |
Merge branch 'master-upstream'
Diffstat (limited to 'src/gui/kernel/qkeymapper_s60.cpp')
-rw-r--r-- | src/gui/kernel/qkeymapper_s60.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/gui/kernel/qkeymapper_s60.cpp b/src/gui/kernel/qkeymapper_s60.cpp index f0b17ac..bcf32a5 100644 --- a/src/gui/kernel/qkeymapper_s60.cpp +++ b/src/gui/kernel/qkeymapper_s60.cpp @@ -40,7 +40,11 @@ ****************************************************************************/ #include "private/qkeymapper_p.h" +#include <private/qcore_symbian_p.h> #include <e32keys.h> +#include <e32cmn.h> +#include <centralrepository.h> +#include <biditext.h> QT_BEGIN_NAMESPACE @@ -214,4 +218,32 @@ int QKeyMapperPrivate::mapQtToS60ScanCodes(int qtKey) } return res; } + +void QKeyMapperPrivate::updateInputLanguage() +{ +#ifdef Q_WS_S60 + TInt err; + CRepository *repo; + const TUid KCRUidAknFep = TUid::Uid(0x101F876D); + const TUint32 KAknFepInputTxtLang = 0x00000005; + TRAP(err, repo = CRepository::NewL(KCRUidAknFep)); + if (err != KErrNone) + return; + + TInt symbianLang; + err = repo->Get(KAknFepInputTxtLang, symbianLang); + delete repo; + if (err != KErrNone) + return; + + QString qtLang = QString::fromAscii(qt_symbianLocaleName(symbianLang)); + keyboardInputLocale = QLocale(qtLang); + keyboardInputDirection = (TBidiText::ScriptDirectionality(TLanguage(symbianLang)) == TBidiText::ERightToLeft) + ? Qt::RightToLeft : Qt::LeftToRight; +#else + keyboardInputLocale = QLocale(); + keyboardInputDirection = Qt::LeftToRight; +#endif +} + QT_END_NAMESPACE |