You Are Here:

Community: Wiki


TSS001313 - Capturing key events using Animation dll

From Forum Nokia Wiki



ID TSS001313 Creation date February 25, 2009
Platform S60 3rd Edition, FP1
S60 3rd Edition, FP2
S60 5th Edition
Tested on devices Tested on Nokia N95,
Navi 6210,
Nokia 5800 XpressMusic
Category Symbian C++ Subcategory Animation, Graphics


Keywords (APIs, classes, methods, functions): Animation dll, CAnim, RAnim, raw events

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);
}

Related Wiki Articles

No related wiki articles found

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia 
RDF Facets: qdcZidentifierQSxhttpE3aE2fE2fwikiE2eforumE2enokiaE2ecomE2findeE78E2ephpE2fTSS001313E5fE2dE5fCapturingE5fkeyE5feventsE5fusingE5fAnimationE5fdllX qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfntypeZCommunityContentQ qdcZtypeQUqfntypeZKnowledgeBaseContentQ qdcZtypeQUqfntypeZE52esourceQ qdcZtypeQUqfntypeZTechnicalSolutionQ qdcZtypeQUqfntypeZWebpageQ qdcZtypeQUqfntypeZWikiContentQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qfnZtopicQUqfnTopicZanimationQ qfnZtopicQUqfnTopicZgraphicsQ qfnZtypeQUqfntypeZCommunityContentQ qfnZtypeQUqfntypeZKnowledgeBaseContentQ qfnZtypeQUqfntypeZE52esourceQ qfnZtypeQUqfntypeZTechnicalSolutionQ qfnZtypeQUqfntypeZWebpageQ qfnZtypeQUqfntypeZWikiContentQ qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfntypeZCommunityContentQ qrdfZtypeQUqfntypeZKnowledgeBaseContentQ qrdfZtypeQUqfntypeZE52esourceQ qrdfZtypeQUqfntypeZTechnicalSolutionQ qrdfZtypeQUqfntypeZWebpageQ qrdfZtypeQUqfntypeZWikiContentQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ
User Rating: qfnZuserE5FratingQNx2E2E0000X