Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

Single tap on symbian^3

From Wiki
Jump to: navigation, search
Article Metadata

shenjianguo 在 07 May 2010 创建
最后由 hamishwillee 在 15 Dec 2011 编辑

In S60 5th 中,可以通过 single tap,long tap,double tap 来处理列表或菜单,到了Symbian^3只要single tap就可以实现以前的功能,更方便也更人性化,下面我们移植一个应用,在Forum Nokia下载CalendarAPIexample,这是个S60 5th程序,在S60 5th SDK下可以编译运行。技术文档可以下载

在Symbian^3 SDK中,需要做如下修改:

.pkg文件中增加Symbian^3 支持

[0x20022E6D], 0, 0, 0, {"Series60ProductID"}

CalendarAPIexample.mmp 文件增加

SYSTEMINCLUDE \epoc32\include\mw SYSTEMINCLUDE \epoc32\include\platform\mw 支持symbian 3 的 .h 文件

CAPABILITY ReadUserData WriteUserData WriteDeviceData 能力增加WriteDeviceData,这个是和以前有区别的,没有这项在真机运行会报错

CalendarAPIexampleAppUi.cpp 文件的 ConstructL() 函数做如下修改:

BaseConstructL(EAknEnableSkin | EAknEnableMSK);


BaseConstructL(EAknEnableSkin | EAknTouchCompatible | EAknSingleClickCompatible);

EAknEnableMSK 纯触屏手机不会有这个键 EAknTouchCompatible 区别Touch和非Touch事件 EAknSingleClickCompatible 让我们的应用可以处理 Single Tap


if (aEventType == EEventEnterKeyPressed || aEventType == EEventItemDoubleClicked)


if (aEventType == EEventEnterKeyPressed || aEventType == EEventItemSingleClicked)

不再处理 double tap,只处理 single tap事件。

至此,可以编译运行,并在真机看看效果,已经可以处理 single tap事件了。

但是在选项菜单中,还有相对应的菜单项,symbian^3 提供了两个标识EEikMenuItemAction, EEikMenuItemSpecific这些菜单项


RESOURCE MENU_PANE r_calendarapiexample_search_menu
items =
MENU_ITEM { command = ECalendarAPIexampleCmdSearch; txt = qtn_options_search; <span style="color:##ff0000"> flags = EEikMenuItemAction;</span> },
MENU_ITEM { command = ECalendarAPIexampleCmdAdd; txt = qtn_options_add; },
MENU_ITEM { command = EAknCmdExit; txt = qtn_options_exit; }
RESOURCE MENU_PANE r_calendarapiexample_entries_menu
items =
MENU_ITEM { command = ECalendarAPIexampleCmdEdit; txt = qtn_options_edit; <span style="color:##ff0000">flags = EEikMenuItemAction;</span> },
MENU_ITEM { command = ECalendarAPIexampleCmdDelete; txt = qtn_options_delete; <span style="color:##ff0000">flags = EEikMenuItemSpecific;</span> }


Image001.jpg Image004.jpg

Image006.jpg Image008.jpg


Image010.jpg Image012.jpg

这是EEikMenuItemSpecific的操作过程:button down -> hold -> pop up menu。

而EEikMenuItemAction 的操作时:button down -> button release -> action。


This page was last modified on 15 December 2011, at 05:29.
334 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.


Thank you!

We appreciate your feedback.