Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

How to Enable/Disable Pointer Repeat Events

From Wiki
Jump to: navigation, search

This snippet shows how to Enable or Disable Repeated Pointer Events in Symbian C++.

Article Metadata
Tested with
Devices(s): Nokia 5800 XpressMusic.
Platform(s): S60 5th Edition
S60 5th Edition
Platform Security
Signing Required: Self-Signed
Capabilities: None
Keywords: TPointerEvent::EButtonRepeat, Pointer Repeat Events, HandlePointerEventL().
Created: vasant21 (30 Nov 2008)
Last edited: hamishwillee (08 Feb 2012)



Repeat Pointer Events can be useful if you want some scrolling or some animation effect for your control, One of the basic Use Case for getting Pointer Repeat Events is for a scrollbar, so that holding down the pointer results in a continuous scroll.


Here we assume that we already have a working code for UI based Application.

MMP file

The following capabilities and libraries are required:

LIBRARY cone.lib 
include <COECNTRL.H>

Enabling Request for Pointer Repeat Event

For getting the Repeat Pointer Events, RWindowBase::RequestPointerRepeatEvent() can be used.

Note that the function RequestPointerRepeatEvent(TTimeIntervalMicroSeconds32 aTime, const TRect &aRect) instructs the window server to send a single pointer repeat event if the pointer state that caused the last event (e.g. EButton1Down) has not changed within aTime and the pointer has not moved outside aRect.

Inside the code that treats EButtonUp pointer event you must call RequestPointerRepeatEvent to set time interval between events and the rect where this event occurs.

 switch (aPointerEvent.iType)
case TPointerEvent::EButton1Down:
// Do Something.
// EButton1Down was pressed, so now is the time to request for repeat events,
// so that we can get continuous repeat events, until pointer state changes.
Window().RequestPointerRepeatEvent(TTimeIntervalMicroSeconds32 (20000), iRepeatRect);
case TPointerEvent::EButtonRepeat:
// Its a repeat event, do whatever is required for eg: moving control in the direction
// of pointer position or perform some animation, or perform some calculations etc..

Disabling Pointer Repeat Event

For cancelling Pointer Repeat Events use RWindowBase::CancelPointerRepeatEventRequest();


Pointer Repeat Events are Enabled/Disabled.

This page was last modified on 8 February 2012, at 05:14.
24 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.


Thank you!

We appreciate your feedback.