PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Pointer events on 5th edition

Hi,
I use Edgelib v3.96, I created a symbian query dialog box
as follows:

Code:
CAknTextQueryDialog *dlg = new (ELeave)CAknTextQueryDialog( defaultText );
dlg->ExecuteLD(R_DIALOG_TEXT_EDIT_QUERY);


When I test it on 5th edition devices (Nokia5800) all the pointer events are sent to Edge and they are not received by the dialog box.

I tried to "forward" the events from edge OnStylusDown(POINT pnt) to the open text box as follows:
Code:
CEikEdwin* pDialogBox = (CEikEdwin*)(m_pESSharedData->m_pDialogBox);
TPointerEvent pointerEvent;
pointerEvent.iType=TPointerEvent::EButton1Down;
pointerEvent.iParentPosition = TPoint(285,598);
pointerEvent.iPosition = TPoint(285,19);

pDialogBox->ClaimPointerGrab();
pDialogBox->SetPointerCapture(true);

pDialogBox->HandlePointerEventL(pointerEvent);


But I didn't get any response from the dialog box.

Does anyone knows any workaround?

Thanks,
Asaf.
Hi Pinhassi,

We suggest implementing the OnNativeEvent callback in your framework. Then using the parameters to get the Symbian event. Here is a sample:

Code:

bool ClassMain::OnNativeEvent(ENATIVETYPE winhandle, ENATIVETYPE msg, ENATIVETYPE param1, ENATIVETYPE param2)
{
RWindow *window = (RWindow *)winhandle;
TWsEvent *aEvent = (TWsEvent *)msg;
CCoeControl *aDestination;
}


A few suggestions you can try to make your input control work:
- Forward the event in the callback to your dialog window
- Return true in the callback function after handling your event
- After handling your pointer and/or key event call CSymAppUi::HandleWsEventL(aEvent, aDestination)
pinhassi · 21 Jun 2009, 13:05 UTC — Pointer events on 5th edition
Hi,
First, thanks for the help.
It works, but...

I did as you suggested:
Code:
pDialogBox->HandlePointerEventL( *(aEvent->Pointer()) );


The virtual keyboard opens, but the OK/Cancel buttons doesn't respond, so is the "change writing language" menu that is opened from the virtual keyboard.

I also tried calling WsEvent as follows:
Code:
CCoeControl *aDestination = pDialogBox;
((CCoeAppUi*)(CEikonEnv::Static()->EikAppUi()))->HandleWsEventL(*aEvent,aDestination);


But is causes an endless loop at ClassMain::OnNativeEvent. I used a flag to prevent the loop, but it didn't work anyway (the dialog didn't receive the event at all).

Is there a way to pass the event to these objects?

Thanks,
Asaf.
Hi Pinhassi,

We recommend to forward all events to the dialog box, not just pointer events. Most important is to forward the EEventKey, EEventKeyUp and EEventKeyDown events.
Still doesn't work...

Since CAknTextQueryDialog can't handle TWsEvent, I had to extract the events I needed and send them separately.


Code:
bool ClassMain::OnNativeEvent(ENATIVETYPE winhandle, ENATIVETYPE msg, ENATIVETYPE param1, ENATIVETYPE param2)
{
CAknTextQueryDialog* pDialogBox = (CAknTextQueryDialog*)(m_pESSharedData->m_pDialogBox);
if (pDialogBox!=NULL)
{

TWsEvent *aEvent = (TWsEvent *)msg;
int nEventType = aEvent->Type();

if (nEventType == EEventPointer )
{
int nEventPointerType = aEvent->Pointer()->iType;
pDialogBox->HandlePointerEventL( *(aEvent->Pointer()) );
return true;

}else if (nEventType == EEventKey || nEventType == EEventKeyUp || nEventType == EEventKeyDown )
{
pDialogBox->OfferKeyEventL( *(aEvent->Key()),(TEventCode)nEventType );
return true;
}

}
return false;
}



Still the problem remains - The virtual keyboard opens, but the OK/Cancel buttons doesn't respond, so is the "change writing language" menu that is opened from the virtual keyboard.


Any suggestions?
Have you tried it yourself or you have a working code?

Thanks for your help,
Pinhassi.
Hi Pinhassi,

Unfortunately, we don't have a real device for testing. Can you provide us with a project running on the emulator?
Hi,

I used the EDGE Helloworld example and added the dialogbox code.
My additions are marked as "//// ADDED ////".

I compiled the code with workspace_s60_e3rd\build_auto.bat

You can see that on 3rd edition devices it works great. The problems begin when I start to run it on 5th edition devices (Nokia5800).

If you want to test it on a real device you can always use Nokia Remote Device Access Services.

Thanks for your help,
Asaf.
Attachments:
MyHelloworld.zip (832 KB)