Alpha keys vs. numeric keys (on Nokia E61)
| Tue, 2006-12-19 17:44 | |
|
Hello all. I have a custom control (CCoeControl) that handles key input via the OfferKeyEventL method. There's a "feature" that is happening that I don't know how to turn off.
The Nokia E61 has a QWERTY keyboard. The numeric keys (0-9) are located over the alpha keys (A-Z), and you press the green button to access them. However, for my control, when you press the keys which have the numbers on them, you receive the number instead of the letter. But for the other keys, which only have puncuation on them, you receive the letter. Basically I can get Q, W, E, but no R, T, Y because RTY comes back as 123! I bet I can change this somehow, but I can't find anything in the SDK. I tried adding the following to my code, but the same behavior persists: Code: TCoeInputCapabilities CScrollCtrl::InputCapabilities() const { return TCoeInputCapabilities(TCoeInputCapabilities::EWesternAlphabetic | TCoeInputCapabilities::ENonPredictive); } Thanks, -euroq |
|






Forum posts: 732
Forum posts: 149
Solution Applications should always use standard Avkon editor controls for text input.
I wish, at least, whomever wrote that article had the gumption to admit that it was either a mistake on someone's part or a terrible design flaw. You cannot expect every application to not use the keyboard except for Avkon editor controls. You cannot expect every application to only need alphabet keys for text entry.
I am seriously pissed. I can manually short circuit the keys by translating "1"->"R" and so on, but then what happens when the phones change.
Symbian OS's 3rd Edition has been a nightmare.
Forum posts: 149
The following code will take a scan code and return the first key in lowercase that would appear if you were using a text editor (i.e. when you press "F" on the keyboard it can correspond to F and 4; first "F" appears, but if you press "F" again it is replaced by a 4). If, for example, you don't want the 4 when pressing "F" (which is the default on a CCoeControl) you can translate it with this:
// Header file
CPtiEngine *iEngine;
CPtiQwertyKeyMappings* iQwertyKeyMappings;
// Source file
#ifdef __SERIES60_30__
TUint CMyCtrl::GetTranslatedKey(TInt aScanCode)
{
if (iEngine == NULL)
{
iEngine = CPtiEngine::NewL(/*ETrue*/);
CPtiCoreLanguage* iCoreLanguage = static_cast<CPtiCoreLanguage*>
(iEngine->GetLanguage(User::Language()));
// Get the keyboard mappings for the language
iQwertyKeyMappings = static_cast<CPtiQwertyKeyMappings*>
(iCoreLanguage->GetQwertyKeymappings());
}
TPtiKey key = (TPtiKey)aScanCode;
// gets something like "aáªäà âãåæe", but first is (we think?) what we want
TBuf<64> result;
iQwertyKeyMappings->GetDataForKey(key, result, EPtiCaseLower);
return result[0];
}
Forum posts: 21
we r using CEikGlobalTextEditor and CEikRichTextEditor, and both r working fine on E61/N73/N80 etc.
editor->ConstructL(this, 1, 16, EAknEditorFlagNoEditIndicators | EEikEdwinNoWrap, EGulFontControlAll, EGulNoSymbolFonts);
editor->SetAknEditorCase(EAknEditorLowerCase);
saur
Forum posts: 149
This message thread is not referring to the standard text editors, it is referring to custom CCoeControls.
-euroq