Thursday, April 03, 2008

How To: avoid repetitive key events when pressing a key?

Use TEventCode to only capture EEventKeyDown:

TKeyResponse CAppUi::HandleKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType)
{
if((aKeyEvent.iScanCode == ‘*’)&& aType == EEventKeyDown)
{
iMenuView->HandleCommandL(ECommand);
return EKeyWasConsumed;
}
else
return EKeyWasNotConsumed;
}

No comments:

stats counter