How to get the character value from the key envent?

Login to reply to this topic.
Thu, 2006-01-19 10:25
Joined: 2005-09-08
Forum posts: 6
For example, press numeric 2 key,I want to get the value 'a' and multiple press numeric 2 key I want to get the character value 'b' or 'c'. How can I do that?Thanks!!!

Thu, 2006-01-19 22:59
Joined: 2004-05-29
Forum posts: 149
Re: How to get the character value from the key envent?
Code:
TKeyResponse CYourCntrClass::OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType)
{
if (aType == EEventKey)
{
switch(aKeyEvent.iCode)
{
case 'a': case 'A':
case EKeyHome:
// etc...
}
}
}
Fri, 2006-01-20 06:56
Joined: 2003-10-08
Forum posts: 106
Re: How to get the character value from the key envent?
I think the OP  wants to replicate the multiple characters on a single button functionality rather than just get a single character. Maybe you could setup a small timer which needs to expire before the cursor can be moved ahead ... so if the timer is for 30ms, and the user presses the key within that time, you go from 'a' to 'b', else you move the cursor one step forward and print an 'a' again.

Regards,
Varun

Mon, 2007-08-13 07:44
Joined: 2007-07-10
Forum posts: 2
Re: How to get the character value from the key envent?

I have read in symbian os internals that wserv does this internaly. But there might be some call which invokes that facility (may be something with repeats)
Could someone plz help me out.

Mon, 2007-08-13 09:02
Joined: 2004-05-21
Forum posts: 286
Re: How to get the character value from the key envent?

Check out Check out the RWsSession::SetModifierState & EModifierNumLock. But this needs WriteDeviceData capability.

AFAIK there is no direct api to get this information.

Cheers,
Sri

  • Login to reply to this topic.