Namespaces
Variants
Actions

How can I detect the "ABC" key event using Symbian C++?

Jump to: navigation, search



Article Metadata

Compatibility
Platform(s): S60 1st Edition
S60 2nd Edition

Article
Created: User:Technical writer 2 (04 Jun 2004)
Last edited: hamishwillee (14 Jun 2012)

Overview

How can I detect the "ABC" key?

Description

What are the TKeyEvent.iCode and iScanCode values of the "ABC" (pencil) key?

Solution

The ABC key is mapped to the Shift modifier key in S60. The following code detects it:
 TKeyResponse CMyClass::OfferKeyEventL(...)
    {
    TBool shiftKeyPressed = (aKeyEvent.iModifiers & EModifierShift);
    ...
    }
The keycode and scancodes depend on the key pressed with the Shift key. The following code detects Shift+OK combination in a listbox's OfferKeyEventL(), where it is used to mark a listbox item:
TKeyResponse CMyBusinessClass::OfferKeyEventL(...)
    {
    TBool shiftKeyPressed = (aKeyEvent.iModifiers & EModifierShift);
    if (shiftKeyPressed && aKeyEvent.iCode==EKeyOK)
        DoSomething();
    ...
    }

This page was last modified on 14 June 2012, at 08:59.
82 page views in the last 30 days.
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved