×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Dec 2003
    Location
    Munich / Germany
    Posts
    20

    HandleKeyEventL seems to be not called

    Hi all,

    I'm trying to write my first mini-application and I wanted
    to re-act to some key-presses (the "joystick"-keys of the 3650)

    I created a new app with the VC6 AppWizard and it provided me
    with a - initially empty - HandleKeyEventL method.

    If modified that - very simply just ot find out whether I'm poking around at the right place and how it reacts.

    The problem is:
    No matter what key I press, it just simply seems to be never called.

    Here's the code:

    TKeyResponse CMyExampleAppUi::HandleKeyEventL(
    const TKeyEvent& aKeyEvent,TEventCode aType)
    {
    CAknInformationNote* note = new (ELeave) CAknInformationNote;
    _LIT(amsg,"Hey, you pressed some key");
    note->ExecuteLD(amsg);
    return EKeyNotConsumed;
    }

    As much as I learned from other postings, this would give me three notes for any key (key press, key release and something), but it gives me ntohin'.

    Does anyone know, what I did wrong ?

    Benno
    Last edited by perlfan; 2004-01-30 at 15:58.

  2. #2
    Registered User
    Join Date
    Dec 2003
    Location
    Munich / Germany
    Posts
    20

    Has been answered elsewhere

    Since I was not able to delete my own posting I have to talk to myself.

    The problem is discussed in quite deep detail in the post

    http://discussion.forum.nokia.com/fo...leKeyEventL%2A

    In short, the problem was that the default implementation off OfferKeyEventL in CEikDialog "eats" the key.

    I had to override OfferKeyEventL in the dialog to return
    KeyWasNotConsumed to get the keypresses through to my
    HandleKeyEventL.

    Well, since an AppWizard should make life easier, OfferKeyEventL should have been in AW-created dialog, I think.

    Anyway, this way I learnt a bit about how this events are processed.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×