智手移动中文网's Archiver

智手小石头 发表于 2006-5-9 11:09

sdk中手机震动的编程接口

S60 2.0引进了振动API,要使用这个API,需要在代码添加头文件vibractrl.h,并在MMP文件中添加vibractrl.lib,但有一点是用户设置里必须开启振动。楼主可以先看看vibractrl.h中相关类的说明。

IMPORT_C static CVibraControl* NewL();
IMPORT_C static CVibraControl* NewL(MVibraControlObserver* aCallback);
IMPORT_C static CVibraControl* NewLC(MVibraControlObserver* aCallback);

应该是通过上面三个函构建一个CVibraControl对象,然后调用它StartVibra(TUint16 aDuration),StopVibra(void)来启动/停止振动。

页: [1]

Powered by Discuz! Archiver 6.1.0  © 2001-2007 Comsenz Inc.