×

Discussion Board

Results 1 to 3 of 3

Thread: OfferKeyEventL

  1. #1
    Regular Contributor
    Join Date
    Mar 2003
    Posts
    108

    OfferKeyEventL

    hi,

    i am facing a proplem with getting the compound control to process the keypress events. i am using CEikRichTextEditor to get data from the user, but the parent controls OfferKeyEventL seems to capture and process the keyevents, why? the CEikRichTextEditor gets focus only when i press backspace key.

    Anyone got any ideas as to whats going wrong?

    Thanks,
    Ash

    ...
    ...
    //---- parent control

    TKeyResponse CAaContainer::OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType)
    {
    if (aType!=EEventKey) return EKeyWasNotConsumed;

    // handle inputbox
    if(iBoxFlag)
    {
    iInputBox->OfferKeyEventL(aKeyEvent, aType);
    return EKeyWasConsumed;
    }
    ...
    ...

    }

    //---- compound control

    InputBox::ConstructL()
    {
    ...
    ...
    iInputWindow = new (ELeave) CEikRichTextEditor(TGulBorder(TGulBorder::ENone));
    ...
    ...
    }

    TKeyResponse InputBox::OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType)
    {
    iInputWindow->OfferKeyEventL(aKeyEvent, aType);
    return EKeyWasConsumed;
    }

  2. #2
    Registered User
    Join Date
    Mar 2003
    Posts
    42

    RE: OfferKeyEventL

    Hi Ash,

    I think you should derive a new class CMyRichTextEditor from CEikRichTextEditor where you implement CMyRichTextEditor::OfferKeyEventL

    Etienne

  3. #3
    Regular Contributor
    Join Date
    Mar 2003
    Location
    Tampere
    Posts
    475

    RE: OfferKeyEventL

    Key event goes only to a control, which are placed to the control stack, explicitly. It is the AppUI who put the main control in its ContrucL() to the control stack with the AddToStackL( iAppDialog ); or AddToStackL( iAppContainer ); and remove it when application exit.
    In the framework the dialog is distribute the keys to the dialog line which is in focus. However the Container control, have the responsibility to call is of its subcontrol OfferKeyEventL() depending on the application logic.
    There is an other possibility, when the control is added to the control stack as it came to the focus, and removed when it lost the focus.
    If you prefer or need the second one, please insert the AddToStackL( iInputWindow ); when the focus on the editor and the RemoveFromStack( iInputWindow ); when the focus left the editor.

    Best Regards,
    (V) - Forum Nokia Developer Support

Posting Permissions

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