×

Discussion Board

Results 1 to 3 of 3

Thread: OfferKeyEventL

  1. #1
    Regular Contributor
    Join Date
    Jun 2008
    Posts
    69

    OfferKeyEventL

    Hai
    I have four CEikEdwin editor and I want to navigate from one to another.But when I click on first CEikEdwin the control jumps to the last CEikWindow(that is from 1st to 2nd,2nd to 3rd ,3rd to 4th) instead of the second CEikWindow.
    The code to control the navigation is
    TKeyResponse CEComCalculatorAppView::OfferKeyEventL(const TKeyEvent& aKeyEvent,
    TEventCode aType)
    {
    switch (aKeyEvent.iScanCode)
    {
    case EStdKeyLeftArrow:
    {
    if (iEdwinE && iEdwinE->IsFocused())

    {

    pos=nposD-5;
    cur_pos=0;

    SizeChanged();
    iEdwinE->SetFocus(EFalse);
    iEdwinD->SetFocus(ETrue);

    DrawDeferred();
    return EKeyWasConsumed;
    }

    if (iEdwinD && iEdwinD->IsFocused())

    {

    pos=nposC-5;
    cur_pos=0;
    SizeChanged();
    iEdwinD->SetFocus(EFalse);
    iEdwinC->SetFocus(ETrue);
    DrawDeferred();
    return EKeyWasConsumed;
    }
    if (iEdwinC && iEdwinC->IsFocused())

    {

    pos=nposB-5;
    cur_pos=0;
    focus=0;
    SizeChanged();
    iEdwinC->SetFocus(EFalse);
    iEdwinB->SetFocus(ETrue);
    DrawDeferred();
    return EKeyWasConsumed;
    }

    break;
    }

    case EStdKeyRightArrow:
    {

    if (iEdwinB && iEdwinB->IsFocused())

    {

    pos=nposC-5;
    cur_pos=1;

    SizeChanged();

    iEdwinB->SetFocus(EFalse);
    // iEdwinC->SetDimmed(ETrue);
    iEdwinC->SetFocus(ETrue);
    DrawDeferred();

    return EKeyWasConsumed;
    }

    if (iEdwinC && iEdwinC->IsFocused())

    {

    pos=nposD-5;
    cur_pos=1;
    focus=2;
    SizeChanged();

    iEdwinC->SetFocus(EFalse);
    // iEdwinC->SetDimmed(ETrue);
    iEdwinD->SetFocus(ETrue);
    DrawDeferred();
    return EKeyWasConsumed;
    }

    if (iEdwinD && iEdwinD->IsFocused())

    {

    pos=nposE-5;
    cur_pos=1;
    SizeChanged();

    iEdwinD->SetFocus(EFalse);
    // iEdwinC->SetDimmed(ETrue);
    iEdwinE->SetFocus(ETrue);
    DrawDeferred();
    return EKeyWasConsumed;
    }

    break;
    }


    }

    // Let the focused edit box handle the key event
    if (iEdwinD && iEdwinD->IsFocused())
    {
    return iEdwinD->OfferKeyEventL(aKeyEvent, aType);
    }
    if (iEdwinB && iEdwinB->IsFocused())
    {
    return iEdwinB->OfferKeyEventL(aKeyEvent, aType);
    }
    if (iEdwinC && iEdwinC->IsFocused())
    {
    return iEdwinC->OfferKeyEventL(aKeyEvent, aType);
    }
    if (iEdwinE && iEdwinE->IsFocused())
    {
    return iEdwinE->OfferKeyEventL(aKeyEvent, aType);
    }
    return EKeyWasNotConsumed;

    }


    Please help me to control the navigation.
    BY
    Remyag

  2. #2
    Regular Contributor
    Join Date
    Dec 2007
    Location
    Banglore,India
    Posts
    64

    Re: OfferKeyEventL

    after switch,just put
    if ( aType == EEventKey )
    your problem will be solved

  3. #3
    Regular Contributor
    Join Date
    Jun 2008
    Posts
    69

    Re: OfferKeyEventL

    Hai

    Very Thanks for your reply.I can solve the problem,but I did a little change that is I put 'if ( aType == EEventKey )' before the switch case.
    By
    Remyag

Similar Threads

  1. How to handle EAknSoftkeyBack in OfferKeyEventL
    By tinka_83 in forum Symbian User Interface
    Replies: 5
    Last Post: 2008-04-02, 22:49
  2. Replies: 0
    Last Post: 2006-11-22, 06:40
  3. Replies: 0
    Last Post: 2006-11-21, 17:45
  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
  •