s60 5.0接收UI触击事件

Receiving long tap events

The S60 platform includes CAknLongTapDetector to receive long tap events. CAknLongTapDetector is part of the Touch UI utilities API.

When the stylus is held down in the same position, an animation starts in about 0.15 s to show that the long tap functionality has started. The animation is provided by Avkon and cannot be changed by the application or control. However, animation can be turned off through the CAknLongTapDetector API.

Your class must derive from the MAknLongTapDetectorCallBack interface and implement its virtual HandleLongTapEventL() method.

An example of the header file is presented below.

class CImageConverterContainer : public CCoeControl, MAknLongTapDetectorCallBack
    {
    ...
    private: // From MAknLongTapDetectorCallBack
        void HandleLongTapEventL( const TPoint& aPenEventLocation, const TPoint& aPenEventScreenLocation );
 
    private: // Data
       CAknLongTapDetector* iLongTapDetector;
    ...    
    }

An example of handling long tap events in your code is presented below.

// Create long tap detector
iLongTapDetector = CAknLongTapDetector::NewL(this);
 
// Your component pointer event handling
void CImageConverterContainer::HandlePointerEventL(const TPointerEvent& aPointerEvent)
    {
    // You must tell to long tap detector pointer all events that are received
    iLongTapDetector->PointerEventL(aPointerEvent);
    ...
    }
 
void CImageConverterContainer::HandleLongTapEventL( const TPoint& aPenEventLocation, const TPoint& /*aPenEventScreenLocation*/ )
    {
    // What to do when user did the long tap
    }

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

brew2003

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值