| Reply | « Previous Thread | Next Thread » |
|
这个服务在后台每隔一定时间模拟一个按键操作,发送一个按键消息。并且这个消息能够被前台程序接收到。
这个能否实现呢 |
|
你可以用RWsSession::SimulateKeyEvent()试试,不过能不能成功就不知道了。有人反映用这个不能成功,我没有试过,不知道。
Bluerose |
|
查了一下SDK,也可以通过向程序发送消息的方式
具体的可以查看Class TApaTask的说明。希望这两种办法有一个可以帮助你。任务列表可以在我前几天发的贴子里有。 Bluerose |
|
也就是Sever/Client架构的通信问题。
r60600 |
|
我修改nokia提供的fep例程,达到了模拟的效果,在模拟器上通过运行。我用1来模拟右方向。但到我的手机上就不行了。感觉是和我得系统有冲突。我得系统是 中文12版。准备刷一个英文版试用一下
|
|
做出来共享一下经验,好让后来的人少走一点弯路。
Bluerose |
|
我用TApaTaskList 和TApaTask 做了测试
在程序中取得系统的 任务列表 ApaTaskList 然后从中取得最前端的 任务,向任务发送按键。 成功。 如何上传附件 |
|
TKeyResponse CTaskManContainer::OfferKeyEventL(
const TKeyEvent& aKeyEvent,TEventCode aType) { // See if we have a selection TInt code = aKeyEvent.iCode; switch(code) { // is navigator button pressed case EKeyRightArrow: { RWsSession rwsSession;//创建Window Server session rwsSession.Connect();//连接window server TApaTaskList apaTL(rwsSession);//创建 任务列表任务 TApaTask apaT=apaTL.FindByPos(0);//取得foreground任务 if(apaT.Exists()) { TKeyEvent KeyEvent; KeyEvent.iCode=EKeyMenu; apaT.SendKey(KeyEvent);//发送按键 } rwsSession.Close(); } return (EKeyWasConsumed); break; default: // Let Listbox take care of its key handling return (EKeyWasConsumed); break; } } |
|
TKeyResponse CExampleFepControl::OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aEventCode)
{ TInt keyCode = aKeyEvent.iCode; /////////////Test KeyConvert///////////////////// if (keyCode=='1') { TKeyResponse response=EKeyWasConsumed; SimulateKeyEventL(EKeyRightArrow);//模拟右方向键 return response; } /////////////Test KeyConvert///////////////////// TKeyResponse response = EKeyWasNotConsumed; return response; } void CExampleFepControl::SimulateKeyEventL(TUint aKeyCode) { CArrayFix<TUint>* simCharArray=new(ELeave) CArrayFixFlat<TUint>(1); CleanupStack::PushL(simCharArray); simCharArray->AppendL(aKeyCode); iFep.SimulateKeyEventsL(simCharArray->Array()); CleanupStack::PopAndDestroy(); // simCharArray } 訽理:系统运行的程序都会在打开的时候去连接当前输入法的dll文件,例如常见的t9fep.fep和chinifep.fep 这些程序都放在 \System\fep目录下,程序运行时所有的按键都先被这个dll 文件截取,因此利用 nokia 提供的fep例程 在其中添加了模拟按键的测试部分,在模拟器上通过,但在手机上没有成功。感觉是和系统本身的输入法有冲突。为此我已綺拔了 n多次电池。wildskinz也用了 FEP实现界面最下方的图片显示。 |
|
我是新手呀......我想知道上面那段程序要配起来用,是不是还要加什么进去的。我加了几个.h文件,但是还是 说我 没有定义...
代码: TApaTaskList apaTL(CCoeEnv::Static()->WsSession()); TApaTask apaT = apaTL.FindByPos(0); TKeyEvent KeyEvent; KeyEvent.iCode=EKeyMenu; apaT.SendKey(KeyEvent); problem: Severity and Description Path Resource Location Creation Time Id Undefined symbol: 'class TApaTask TApaTaskList::FindByPos(int) (?FindByPos@TApaTaskList@@QAE?AVTApaTask@@H@Z)'[] YahooImage Unknown 1191035638644 1411 Undefined symbol: 'TApaTaskList::TApaTaskList(class RWsSession &) (??0TApaTaskList@@QAE@AAVRWsSession@@@Z)'[] YahooImage Unknown 1191035638644 1410 Undefined symbol: 'void TApaTask::SendKey(struct TKeyEvent const &) (?SendKey@TApaTask@@QAEXABUTKeyEvent@@@Z)'[] YahooImage Unknown 1191035638644 1412 |
|
Quote:
|
| beover1984 |
| View Public Profile |
| Find all posts by beover1984 |
|
系统运行的程序都会在打开的时候去连接当前输入法的dll文件,例如t9fep.fep和chinifep.fep 这些程序都放在 \System\fep目录下[/quote]
为什么我在我的系统文件下找不到t9fep.fep和chinifep.fep呢??我的是第三版,这是什么原因呢? |
|
Quote:
3版里所有的exe, dll必须在/sys/bin目录, 否则不能执行, 所以你见不到. |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Rate This Thread | |