Creating the long-tap detector

To use the long-tap detector in your application, create an instance of the class CAknLongTapDetector .

You must give the long-tap detector constructor a pointer to the owner; otherwise the detector doesn’t know where to report long tap events.

You cannot set other long-tap detector parameters in the constructor. To change these parameters, use the other methods in the API after the detector is succesfully constructed.

You also need to pass any pointer events from the client side component to the long-tap detector and enable pointer grab for the control’s window.

      void CMyContainer::ConstructL( const TRect& aRect )
    {
    …
    iLongTapDetector = CAknLongTapDetector::NewL( this );
    DrawableWindow()->SetPointerGrab( ETrue );
    …
    }

void CMyContainer::HandlePointerEventL( const TPointerEvent& aEvent )
    {
    …
    iLongTapDetector->PointerEventL( aEvent );
    …
    }