diff -r 43e37759235e -r 51a74ef9ed63 Symbian3/SDK/Source/GUID-E1E11C95-3400-548B-AEEE-577DA8FB9ECB.dita --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Symbian3/SDK/Source/GUID-E1E11C95-3400-548B-AEEE-577DA8FB9ECB.dita Wed Mar 31 11:11:55 2010 +0100 @@ -0,0 +1,35 @@ + + + + + +Processing Window Events

The following examples demonstrate how to process window-related event types, which are events local to specific windows and include pointer events.

Variant: ScreenPlay and non-ScreenPlay. Target audience: Application developers.

Pointer events

To detect if a pointer event has been issued, use the EEventPointerEnter, EEventPointerExit, EEventPointer and EEventDragDrop event types.

You can request information about the pointer event type by calling the TWsEvent::Pointer() function.

// Pointer events + case EEventPointer: + case EEventDragDrop: + { + // Gets the pointer position + TPointerEvent& pointerEvent = *iWsEvent.Pointer(); + TPoint point = pointerEvent.iPosition; + break; + }
Pointer events are ready to retrieve from a buffer

To detect whether pointer events are ready to retrieve from a buffer, use the EEventPointerBufferReady event type.

The RWindowBase::EnablePointerMoveBuffer() function instructs the Window Server to begin putting pointer events into the pointer move buffer.

You can get the buffer containing the stored pointer events by calling RWindowBase::RetrievePointerMoveBuffer().

// Pointer events are ready to retrieve from a buffer + case EEventPointerBufferReady: + { + const TInt KPointerMoveBufferSize = 20; + + // Gets the window + RWindow* window = (RWindow*)(iWsEvent.Handle()); + + // Set up an array of TPoints into which to read the buffer + TPoint pnts[KPointerMoveBufferSize]; + TPtr8 ptr((TUint8 *)&pnts;,sizeof(pnts)); + TInt numPts = window -> RetrievePointerMoveBuffer(ptr); + break; + } +

Note that the way to map the handle to a window depends on the environment that you are working in, usually this will be the UI Control Framework which will have to do this mapping a different way.

Pointer Handling Advanced Pointers General Events Processing Window-Group + Events
\ No newline at end of file