Use the MCoeControlObserver observer interface to observe button events. Set the button container to be its observer.
For more information on events, see Event handling .
void CMyAppContainer::HandleControlEventL( CCoeControl* aControl,
TCoeEvent aEventType )
{
switch ( aEventType )
{
// Button state changed (button was pressed)
case EEventStateChanged:
…
break;
// Button is pressed for a long time (in case of
// a KAknButtonReportOnLongPress flagged button)
case CAknButton::ELongPressEvent:
…
break;
// Button long press ended (in case of
// a KAknButtonReportOnLongPress flagged button)
case CAknButton::ELongPressEndedEvent:
…
break;
default:
break;
}
}
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.