×
Namespaces

Variants
Actions
Revision as of 07:37, 30 May 2013 by hamishwillee (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Capturing key events using Animation dll

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata
Tested with
Devices(s): Tested on Nokia N95,
Navi 6210,
Nokia 5800 XpressMusic
Compatibility
Platform(s): S60 3rd Edition, FP1
S60 3rd Edition, FP2
S60 5th Edition
Nokia Belle
Symbian Anna
Symbian^3
S60 5th Edition
S60 3rd Edition FP2
S60 3rd Edition FP1
Article
Keywords: Animation dll, CAnim, RAnim, raw events
Created: User:Technical writer 1 (25 Feb 2009)
Last edited: hamishwillee (30 May 2013)

Overview

An animation DLL defines a framework for polymorphic DLLs that perform animations. However, it can also be used to get the raw window server events.

This article provides an additional aspect of capturing raw events using an animation DLL. The animation example already present in S60 examples does not include code for raw event handling.

All the raw events can be received and handled in MEventHandler::OfferRawEvent(). This function is implemented in an CAnim-derived class. This function should return EFalse, otherwise the foreground application or applications that have registered to get key events using RWindowGroup::CaptureKey() will not receive them.

 TBool CImage::OfferRawEvent( const TRawEvent& aRawEvent )
{
// To capture Zero key press
if(aRawEvent.Type()==TRawEvent::EKeyDown && aRawEvent.ScanCode()=='0')
{
// Event handling code
}
return EFalse;
}

These events are offered to MEventHandler::OfferRawEvent() only if raw event handling is switched on. This is done by calling MAnimGeneralFunctions::GetRawEvents(ETrue). An object of class MAnimGeneralFunctions is not created. The class is implemented by the window server and provides utility functions to all CAnim-derived classes via CAnim::iFunctions pointer. So in order to receive raw events, add the following code to ConstructL of the CAnim-derived class:

 void CImage::ConstructL( TAny* /*aArgs*/, TBool /*aHasFocus*/ )
{
iFunctions->GetRawEvents(ETrue);
}
This page was last modified on 30 May 2013, at 07:37.
66 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.

×