diff -r ebc84c812384 -r 46218c8b8afa Symbian3/PDK/Source/GUID-E1E11C95-3400-548B-AEEE-577DA8FB9ECB.dita --- a/Symbian3/PDK/Source/GUID-E1E11C95-3400-548B-AEEE-577DA8FB9ECB.dita Thu Mar 11 15:24:26 2010 +0000 +++ b/Symbian3/PDK/Source/GUID-E1E11C95-3400-548B-AEEE-577DA8FB9ECB.dita Thu Mar 11 18:02:22 2010 +0000 @@ -1,35 +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 + + + + + +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