Join Now
Quality Rating:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)
Expertise Level:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)

This page was last modified 08:19, 2 May 2008.

CS000932 - Enabling and disabling keypad lock

From Forum Nokia Wiki


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();
Related Discussions
Thread Thread Starter Forum Replies Last Post
N95 AGPS timeout problem illes79 Location Based Services and Navigation 1 2007-10-16 00:12
How to handle sliding event abhijeetguptag Mobile Java General 3 2008-01-21 09:37
Hang Up from application after dialing from keypad skhimsara General Symbian C++ 0 2006-04-02 17:55
Cover keypad presses on 9300 / 9500? hongse Symbian User Interface 2 2005-08-15 04:50
Lock the Inbox Folder!!! kiran10182 General Symbian C++ 8 2006-07-17 13:24
 
Powered by MediaWiki