×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Nov 2007
    Posts
    98

    CEikEdwin offerkeyeventL

    This isnt big problem, but very annoying.

    I have view with tabs and one edwin.
    I active view but I dont wat to active edwin yet.

    I Press key (like 5) and now I want to active edwin
    and it should display j, but it displays 5 (next char is correct).

    how I should handle key events to get this work.

    Code:
    TKeyResponse CMyView::OfferKeyEventL(
        const TKeyEvent &aKeyEvent, TEventCode aType )
        {
        if( aType == EEventKey )
            {
            switch( aKeyEvent.iCode )
                {
                
                
                default:
                	{
                	if (aKeyEvent.iCode == EKeyLeftArrow || aKeyEvent.iCode == EKeyRightArrow )
                		{
                		if (iSendbox->IsFocused())
                			{
                			return iSendbox->OfferKeyEventL(aKeyEvent, aType);
                			}
                		}
                	else
                		{
    	            	iSendbox->SetFocus(ETrue);
    	            	return iSendbox->OfferKeyEventL(aKeyEvent, aType);
                		}
                	}
                	break;
                }
           
            }
        return EKeyWasNotConsumed;
        }

  2. #2
    Super Contributor
    Join Date
    Jul 2007
    Posts
    596

    Arrow Re: CEikEdwin offerkeyeventL

    Quote Originally Posted by miikkis View Post
    This isnt big problem, but very annoying.

    I have view with tabs and one edwin.
    I active view but I dont wat to active edwin yet.

    I Press key (like 5) and now I want to active edwin
    and it should display j, but it displays 5 (next char is correct).

    how I should handle key events to get this work.

    Code:
    TKeyResponse CMyView::OfferKeyEventL(
        const TKeyEvent &aKeyEvent, TEventCode aType )
        {
        if( aType == EEventKey )
            {
            switch( aKeyEvent.iCode )
                {
                
                
                default:
                	{
                	if (aKeyEvent.iCode == EKeyLeftArrow || aKeyEvent.iCode == EKeyRightArrow )
                		{
                		if (iSendbox->IsFocused())
                			{
                			return iSendbox->OfferKeyEventL(aKeyEvent, aType);
                			}
                		}
                	else
                		{
    	            	iSendbox->SetFocus(ETrue);
    	            	return iSendbox->OfferKeyEventL(aKeyEvent, aType);
                		}
                	}
                	break;
                }
           
            }
        return EKeyWasNotConsumed;
        }
    what about if here we set edwin default mode to text .

    here below i am giving some code to set some edwin flag

    iEditor->SetAknEditorFlags(EAknEditorFlagNoT9);
    iUserNameEditor->SetAknEditorCase(EAknEditorLowerCase);
    iEditor->SetAknEditorCurrentInputMode(EAknEditorTextInputMode);
    iEditor->SetAknEditorNumericKeymap(EAknEditorToFieldNumberModeKeymap);

    where iEditor is a CEikEdwin pointer.

    Thanks

  3. #3
    Registered User
    Join Date
    Nov 2007
    Posts
    98

    Re: CEikEdwin offerkeyeventL

    didnt work... i think the problem is that first time some other control offers that keyevent than edwin. normally if text box is selected by pressing down or upkey first char doest come visible.

  4. #4
    Super Contributor
    Join Date
    Jul 2007
    Posts
    596

    Arrow Re: CEikEdwin offerkeyeventL

    Quote Originally Posted by miikkis View Post
    didnt work... i think the problem is that first time some other control offers that keyevent than edwin. normally if text box is selected by pressing down or upkey first char doest come visible.
    Are you sure you properly get focussed to edwin control.

    Above code will work for setting default mode of edwin to
    character mode not for focussing the control.


    Thanks

  5. #5
    Registered User
    Join Date
    Nov 2007
    Posts
    98

    Re: CEikEdwin offerkeyeventL

    Quote Originally Posted by kishore84 View Post
    Are you sure you properly get focussed to edwin control.

    Above code will work for setting default mode of edwin to
    character mode not for focussing the control.


    Thanks
    got this work

    Code:
        if ( aType == EEventKeyDown)
        	{
        	if (!iSendbox->IsFocused() && !iInputbox->IsFocused())
        		{
        		if (aKeyEvent.iScanCode == 14 || aKeyEvent.iCode == 15 )
        			{
        			return EKeyWasNotConsumed;
        			}
        		else
        			{
    	    		iSendbox->SetFocus(ETrue);
    	    		iSendbox->SetCursorPosL(iSendbox->TextLength(),EFalse);
    	    		return iSendbox->OfferKeyEventL(aKeyEvent, aType);
        			}
        		}
        	}

Similar Threads

  1. CEikEdwin problem
    By Mart1986 in forum Symbian
    Replies: 3
    Last Post: 2008-05-16, 08:38
  2. CEikEdwin and OfferKeyEventL
    By tomjanssens in forum Symbian User Interface
    Replies: 4
    Last Post: 2007-10-18, 10:01
  3. CEikEdwin in CAknDialog (Text Menu)
    By grapentin in forum Symbian User Interface
    Replies: 0
    Last Post: 2007-03-22, 09:47
  4. CEikEdwin and key events
    By aymenn in forum Symbian
    Replies: 2
    Last Post: 2007-03-21, 17:27
  5. CeikEdwin does not produce EEVentTextUpdate
    By ayulo in forum Symbian User Interface
    Replies: 0
    Last Post: 2003-10-22, 09:11

Posting Permissions

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