You Are Here:

Community: Wiki

This page was last modified on 7 May 2009, at 10:44.

如何使用TRawEvent在S60 5th平台上模拟触摸操作

From Forum Nokia Wiki


ID Creation date May 7, 2009
Platform S60 5th Edition Tested on devices Nokia 5800 XpressMusic
Category Touch UI Subcategory Touch UI


Keywords (APIs, classes, methods, functions): touch event
需要能力:SwEvent

1. 在"e32event.h"中,有对TRawEvent类的定义,其中TType这个枚举类型中包含了各种硬件级的事件,包括触摸和键盘等操作.

EButton1Down
EButton1Up

代表了在触摸屏设备上的开始接触触摸屏和离开触摸屏的事件。


2. 使用下面代码你可以模拟出各种触摸事件:

TRawEvent lEventDown;
lEventDown.Set(TRawEvent::EButton1Down, X, Y);
UserSvr::AddEvent(lEventDown);
//可能需要添加一些延迟,或者通过程序逻辑来控制
TRawEvent lEventUp;
lEventUp.Set(TRawEvent::EButton1Up, X, Y);
UserSvr::AddEvent(lEventUp);

3. 请注意在触摸屏手机上,坐标点X,Y的起始点(0,0)默认情况下是针对横屏的,所以某些时候需要必要的坐标转换。

Related Wiki Articles

No related wiki articles found

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia