×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Mar 2004
    Location
    Ukraine
    Posts
    1

    ExecuteLD in OfferKeyEventL

    I'm shoing modal dialog box in two ways - one way from HandleCommandL - it works fine. Another way from OfferKeyEventL.
    In this case program works strange.
    I check for key code and if EStdKeyDevice3 was pressed I create dialog and call ExecuteLD.
    Dialog is contructed, then PreLayoutDynInitL called. After this immideatly called OkToExitL and dialog destructed even haven't been appared on the screen.

    May be it is not possible to call for modal dialogs for offer key event or may be dialog reseives still not consumed key?

    How to solve this problem?

  2. #2
    Registered User
    Join Date
    Nov 2006
    Posts
    12

    Re: ExecuteLD in OfferKeyEventL

    Hi

    I had a problem similar to yours pertaining to OfferKeyEventL. I created a list box and wanted to handle events in OfferKeyEventL. Like for eg. displaying a information note when user selects third item in list box.


    I eventually found out that you have to implement the key event handling in another function called HandleListBoxEventL. Here I get the number of the currently selected list box item using function CurrentItemIndex() And then use a simple switch case based on the number the above function returns.

    Please note that before writing the code for HandleListBoxEventL I had to inherit my container class from MEikListBoxObserver and do forward declaration of MEikListBoxObserver.

    I also had to implement SetListBoxObserver in the ConstructL of the container. I hope this information helps you.

    The point to note is that OfferKeyEventL did not actually handle the key events, it was HandleListBoxEventL which did.

  3. #3
    Registered User
    Join Date
    May 2008
    Posts
    31

    Re: ExecuteLD in OfferKeyEventL

    Quote Originally Posted by n-code View Post
    I'm shoing modal dialog box in two ways - one way from HandleCommandL - it works fine. Another way from OfferKeyEventL.
    In this case program works strange.
    I check for key code and if EStdKeyDevice3 was pressed I create dialog and call ExecuteLD.
    Dialog is contructed, then PreLayoutDynInitL called. After this immideatly called OkToExitL and dialog destructed even haven't been appared on the screen.

    May be it is not possible to call for modal dialogs for offer key event or may be dialog reseives still not consumed key?

    How to solve this problem?
    Was you able to solve this?
    I'm having exact same scenario and I figured that new dialog indeed process still not consumed key.
    The only question is - how to get around it.

  4. #4
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,748

    Re: ExecuteLD in OfferKeyEventL

    On which of the 3 events (KeyDown-Key-KeyUp) do you execute your dialog? And what key are you using?

  5. #5
    Registered User
    Join Date
    May 2008
    Posts
    31

    Re: ExecuteLD in OfferKeyEventL

    Quote Originally Posted by wizard_hu_ View Post
    On which of the 3 events (KeyDown-Key-KeyUp) do you execute your dialog? And what key are you using?
    I tried all 3.

    On KeyDown I have scenario 1 (described in my original post).
    On Key - scenario 1.
    On Up - scenario 2.

    Or, sorry just realized, here

    In my OfferKeyEventL upon pressing Left Soft Key or Enter I call function which checks some condition and outputs a note dialog with the warning.

    The problem is
    Scenario 1
    1) I press left soft key.
    2) On Key event EEventKeyDown I call my function
    3) Check for condition and call note dialog
    4) Boom! Note dialog closes immediately because it captures either EEventKey or EEventKeyUp

    Scenario 2
    1) I press left soft key.
    2) On Key event EEventKeyUp I call my function
    3) Check for condition and call note dialog
    4) This time I can see Note. But when I confirm (press either left soft or enter) note dialog destroyed on EEventKeyDown and
    5) Boom! We again in the OfferKeyEventL and calling my function.
    Infinite loop!

    It looks to me that the only way to break this would be before displaying Note dialog - introduce a small delay (so Note dialog wouldn't catch EEventKeyUp ), but I don't like this approach.

Similar Threads

  1. CEikEdwin and OfferKeyEventL
    By tomjanssens in forum Symbian User Interface
    Replies: 4
    Last Post: 2007-10-18, 10:01
  2. Is ExecuteLD() method of a dialog leave-safe?
    By cl_fragen in forum Symbian User Interface
    Replies: 4
    Last Post: 2005-11-24, 05:33
  3. problem with offerkeyeventl on container
    By rkckolla in forum Symbian User Interface
    Replies: 5
    Last Post: 2004-11-08, 06:06
  4. Read Keyboard instate of OfferKeyEventL
    By lordgraham in forum Symbian
    Replies: 0
    Last Post: 2004-01-08, 09:49
  5. Read Keyboard instate of OfferKeyEventL
    By lordgraham in forum Symbian User Interface
    Replies: 2
    Last Post: 2004-01-08, 09:08

Posting Permissions

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