×

Discussion Board

Results 1 to 9 of 9
  1. #1
    Registered User
    Join Date
    Apr 2008
    Posts
    69

    Question [moved] How to trigger VKB for CEikEdwin in V5?

    I go through the forum about the CEikEdwin& VKB, I still want to post my question here for help:

    I have a view based on CCoeControl, which contains 2 CEikEdwin editors. In s60 v3, I use navi key to move focus from one editor to another, then input by keyboard, it works well.
    In V5, I need change the focus by touch screen. I add following function in the view container following the guide. The focus is changed then, but no Virtu keyboard. Please give me help on this please. Thank you.

    void CEditorContainer::HandlePointerEventL(const TPointerEvent& aPointerEvent)
    {
    // Check if touch is enabled or not
    if( !AknLayoutUtils::PenEnabled() )
    {
    return;
    }
    // Remove last focus
    CCoeControl* iFocusedControl;
    iFocusedControl=ComponentControl(iCurrentControl);
    iFocusedControl->SetFocus( EFalse );

    if (aPointerEvent.iType == TPointerEvent::EButton1Up)
    {
    TPoint inewPointer=aPointerEvent.iPosition;
    if(ifirstEd->Rect().Contains(inewPointer))
    iirstEd->SetFocus(ETrue,EDrawNow);

    if(i2ndEd->Rect().Contains(inewPointer))
    i2ndEd->SetFocus(ETrue,EDrawNow);
    }

    CCoeControl::HandlePointerEventL(aPointerEvent);
    }

  2. #2
    Nokia Developer Champion
    Join Date
    Jan 2008
    Location
    Bangalore, India
    Posts
    777

    Re: How to trigger VKB for CEikEdwin in V5?

    plz look on that, This thread contains some hints,
    http://discussion.forum.nokia.com/fo...d.php?t=149686

  3. #3
    Super Contributor
    Join Date
    Nov 2004
    Posts
    1,009

    Re: How to trigger VKB for CEikEdwin in V5?

    Try this:

    CEikEdwin * editor;
    ...
    MCoeFepAwareTextEditor_Extension1 * extension1 = editor->InputCapabilities().FepAwareTextEditor()->Extension1();
    CAknEdwinState * aknEdwinState = static_cast<CAknEdwinState *> (extension1->State(KNullUid));
    aknEdwinState->ReportAknEdStateEventL(MAknEdStateObserver::EAknActivatePenInputRequest);


    Hope it will help.
    Regards,
    Shafali

  4. #4
    Nokia Developer Champion
    Join Date
    Jan 2008
    Location
    Bangalore, India
    Posts
    777

    Re: How to trigger VKB for CEikEdwin in V5?

    and for complete solution you can find an example from here,
    http://wiki.forum.nokia.com/index.ph...d_with_touchUI

  5. #5
    Nokia Developer Champion
    Join Date
    Oct 2007
    Location
    જુનાગઢ - India
    Posts
    3,034

    Re: How to trigger VKB for CEikEdwin in V5?

    Example in this link might help you.
    http://wiki.forum.nokia.com/index.ph...d_with_touchUI

  6. #6
    Registered User
    Join Date
    Apr 2008
    Posts
    69

    Re: How to trigger VKB for CEikEdwin in V5?

    Nitesh and savaj,
    I run that code, do you mean I need a customed editor? Can you let me know what function is must overrided?

    BTW, when I don't use HandlePointerEventL() in the container, I clicked the editor which has default focus, the VKB is displayed well. Seems just because I add those code in override HandlePointerEventL() beside

    CCoeControl::HandlePointerEventL(aPointerEvent);

    .

    Thank you.
    Landing

  7. #7
    Registered User
    Join Date
    Apr 2008
    Posts
    69

    Re: How to trigger VKB for CEikEdwin in V5?

    Shafali,
    I'm trying your code. Will update. Thank you anyway.

    Regards,
    Landing
    Last edited by xuelanding; 2009-09-09 at 12:33.

  8. #8
    Registered User
    Join Date
    Apr 2008
    Posts
    69

    Re: How to trigger VKB for CEikEdwin in V5?

    All,
    I fixed the problem in a simple way. No special function need. Just use below code:

    void CEditorContainer::HandlePointerEventL(const TPointerEvent& aPointerEvent)
    {
    // Check if touch is enabled or not
    if( !AknLayoutUtils::PenEnabled() )
    {
    return;
    }
    // Remove last focus
    CCoeControl* iFocusedControl;
    iFocusedControl=ComponentControl(iCurrentControl);

    if (aPointerEvent.iType == TPointerEvent::EButton1Up)
    {
    TPoint inewPointer=aPointerEvent.iPosition;
    if(ifirstEd->Rect().Contains(inewPointer))
    if(iCurrentControl!=EfirstEd)
    {
    iFocusedControl->SetFocus(EFalse);
    iirstEd->SetFocus(ETrue,EDrawNow);
    }

    if(i2ndEd->Rect().Contains(inewPointer))
    if(iCurrentControl!=E2ndEd)
    {
    iFocusedControl->SetFocus(EFalse);
    i2ndEd->SetFocus(ETrue,EDrawNow);
    }
    }

    CCoeControl::HandlePointerEventL(aPointerEvent);
    }

    Here is my summary:
    1. The system always send buttondown, drag, buttonup into the function orderly.
    2. The first click is get focus, other click will show vkb. Never change focus every click.
    3. The call to CCoeControl::HandlePointerEventL need not is the last line of the function.

    Thank you all for help!

    Landing

  9. #9
    Regular Contributor
    Join Date
    Jun 2009
    Posts
    92

    Re: How to trigger VKB for CEikEdwin in V5?

    Thank you for the code. :-)

Similar Threads

  1. Closing and Opening of VKB
    By jupitar in forum Symbian C++
    Replies: 3
    Last Post: 2010-01-11, 13:53
  2. [moved] 5th edition - lanuch VKB
    By Liwuje in forum Symbian User Interface
    Replies: 4
    Last Post: 2008-12-15, 19:32
  3. [moved] S60 v5 XpressMusic RAknKeylock2
    By yosefd in forum Symbian C++
    Replies: 1
    Last Post: 2008-10-20, 19:21

Posting Permissions

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