You Are Here:

Community: Wiki

This page was last modified on 22 September 2009, at 09:48.

CS000932 - Enabling and disabling keypad lock

From Forum Nokia Wiki

Reviewer Approved   



ID CS000932 Creation date May 2, 2008
Platform S60 3rd Edition, MR Tested on devices Nokia N95 8GB
Category Symbian C++ Subcategory Hardware


Keywords (APIs, classes, methods, functions): RAknKeyLock, RAknKeyLock::IsKeyLockEnabled(), RAknKeyLock::EnableKeyLock(), RAknKeyLock::EnableWithoutNote(), RAknKeyLock::DisableKeyLock(), RAknKeyLock::DisableWithoutNote(), RAknKeyLock::EnableAutoLockEmulation()

Overview

This code snippet demonstrates the following use cases regarding enabling and disabling keypad lock:

  1. Offering the user to enable the key lock.
  2. Enabling the key lock and showing a notification ("Keypad locked" or similar).
  3. Enabling the key lock without showing a notification.
  4. Disabling the key lock and showing a notification ("Keypad unlocked" or similar).
  5. Disabling the key lock without showing a notification.
  6. Locking the device keys similarly to device lock (unlocking requires a lock code).

This snippet can be self-signed.

MMP file

The following libraries are required:

LIBRARY  avkon.lib

Source file

#include <aknkeylock.h>  // RAknKeyLock
RAknKeyLock keyLock;
// Connect to the notifier server so that key lock state notifications can be
// displayed
User::LeaveIfError(keyLock.Connect());
 
 
// USE CASE 1
// If the key lock is not enabled, ask the user whether it should be
if (!keyLock.IsKeyLockEnabled())
{
keyLock.OfferKeyLock();
}
 
 
// USE CASE 2
// If the key lock is not enabled, enable it and show a notification
if (!keyLock.IsKeyLockEnabled())
{
keyLock.EnableKeyLock();
}
 
 
// USE CASE 3
// If the key lock is not enabled, enable it without showing a notification
if (!keyLock.IsKeyLockEnabled())
{
keyLock.EnableWithoutNote();
}
 
 
// USE CASE 4
// If the key lock is enabled, disable it and show a notification
if (keyLock.IsKeyLockEnabled())
{
keyLock.DisableKeyLock();
}
 
 
// USE CASE 5
// If the key lock is enabled, disable it without showing a notification
if (keyLock.IsKeyLockEnabled())
{
keyLock.DisableWithoutNote();
}
 
 
// USE CASE 6
// Lock the device keys similarly to device lock (unlocking requires a lock
// code)
keyLock.EnableAutoLockEmulation();
 
 
// Close the session with the notifier server
keyLock.Close();

Supplementary material

  • You can test the keypad lock features in action in a simple, executable application into which this code snippet has been patched. The application is available for download at: Media:ExampleStub_CS000932.zip
  • You can examine all the changes that are required to implement keypad lock handling in an application. The changes are provided in unified diff and color-coded diff formats: Media:CS000932_Enabling_and_disabling_keypad_lock.diff.zip
  • For general information on applying the patch, see Using Diffs.
  • For unpatched stub applications, see Example stub.

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: qdcZdescriptionQSxEa0E20WikiE20javaE20symbianE5fosE20s60E20maemoE20cE2bE2bE20WikiE20HomeE20WikiE20HelpE20OverviewE20GlossaryE20CreateE20PageE20ProposeE20anE20ArticleE20SpotlightE20TopicE20E2dE20WE52TE20WidgetsE20ProgrammingE20E4canguageE20E2dE20SymbianE20CE2bE2bE20E2dE20OpenE20CE2fCE2bE2bE20E2dE20JavaE20E2dE20FlashE20E4citeE20E2dE20PythonE20WebE20TechnologiesE20E2dE20WE52TE20WidgetsE20E2dE20WidSetsE20ToolsE20andE20SE44KE20CodeE20E45E78amplesE20KnowledgeE20BaseE20TechnologyE20AreasE20SoftwareE20PlatformsE20E44evelopmentE20ProcessE20E3fE3fWikiE20ChineseE20E3fE3fE3fWikiE20JapaneseE20PortugueseE2fBrazilianE20E52ussianE20WhatE20linksE20hereE20UploadE20fileE20SpecialE20pagesE20PrintableE20versionE44ownloadE20asE20PE44FE20GoE20ToE20E2eE2eE2eX qdcZidentifierQSxhttpE3aE2fE2fwikiE2eforumE2enokiaE2ecomE2findeE78E2ephpE2fNokiaE5fFirmwareE5fVersionsX qdcZpublisherQUxhttpE3aE2fE2fswE2enokiaE2ecomE2fidE2fc764fd1cE2d8b06E2d499aE2d9a6aE2d17c3903d5a65E2fforumE5fnokiaE5fcrawlerE5fagentX qdcZtitleQSxNokiaE20FirmwareE20VersionsE20E2dE20ForumE20NokiaE20WikiX qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfntypeZCommunityContentQ qdcZtypeQUqfntypeZE52esourceQ qdcZtypeQUqfntypeZWebpageQ qdcZtypeQUqfntypeZWikiContentQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qrssZdescriptionQSxEa0E20WikiE20javaE20symbianE5fosE20s60E20maemoE20cE2bE2bE20WikiE20HomeE20WikiE20HelpE20OverviewE20GlossaryE20CreateE20PageE20ProposeE20anE20ArticleE20SpotlightE20TopicE20E2dE20WE52TE20WidgetsE20ProgrammingE20E4canguageE20E2dE20SymbianE20CE2bE2bE20E2dE20OpenE20CE2fCE2bE2bE20E2dE20JavaE20E2dE20FlashE20E4citeE20E2dE20PythonE20WebE20TechnologiesE20E2dE20WE52TE20WidgetsE20E2dE20WidSetsE20ToolsE20andE20SE44KE20CodeE20E45E78amplesE20KnowledgeE20BaseE20TechnologyE20AreasE20SoftwareE20PlatformsE20E44evelopmentE20ProcessE20E3fE3fWikiE20ChineseE20E3fE3fE3fWikiE20JapaneseE20PortugueseE2fBrazilianE20E52ussianE20WhatE20linksE20hereE20UploadE20fileE20SpecialE20pagesE20PrintableE20versionE44ownloadE20asE20PE44FE20GoE20ToE20E2eE2eE2eX qfnZdistributionQUxhttpE3aE2fE2fwikiE2eforumE2enokiaE2ecomE2fX qfnZtopicQUqfnTopicZhardwareQRqdcZtypeQUqrdfsZE52esourceQRqmarsZrelevanceQNx100X qfnZtypeQUqfntypeZCommunityContentQ qfnZtypeQUqfntypeZE52esourceQ qfnZtypeQUqfntypeZWebpageQ qfnZtypeQUqfntypeZWikiContentQ qfnZupdatedQDx2008E2d10E2d01X qfnZuserE5ftagQSxhardwareX qmarsZdescriptionQSxEa0E20WikiE20javaE20symbianE5fosE20s60E20maemoE20cE2bE2bE20WikiE20HomeE20WikiE20HelpE20OverviewE20GlossaryE20CreateE20PageE20ProposeE20anE20ArticleE20SpotlightE20TopicE20E2dE20WE52TE20WidgetsE20ProgrammingE20E4canguageE20E2dE20SymbianE20CE2bE2bE20E2dE20OpenE20CE2fCE2bE2bE20E2dE20JavaE20E2dE20FlashE20E4citeE20E2dE20PythonE20WebE20TechnologiesE20E2dE20WE52TE20WidgetsE20E2dE20WidSetsE20ToolsE20andE20SE44KE20CodeE20E45E78amplesE20KnowledgeE20BaseE20TechnologyE20AreasE20SoftwareE20PlatformsE20E44evelopmentE20ProcessE20E3fE3fWikiE20ChineseE20E3fE3fE3fWikiE20JapaneseE20PortugueseE2fBrazilianE20E52ussianE20WhatE20linksE20hereE20UploadE20fileE20SpecialE20pagesE20PrintableE20versionE44ownloadE20asE20PE44FE20GoE20ToE20E2eE2eE2eX qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfntypeZCommunityContentQ qrdfZtypeQUqfntypeZE52esourceQ qrdfZtypeQUqfntypeZWebpageQ qrdfZtypeQUqfntypeZWikiContentQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ
User Rating: qfnZuserE5FratingQNx4E2E0000X