×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    India
    Posts
    1,174

    Problem in handling right arrow key in OfferKeyEventL() for CEikRichTextEditor

    Hi

    I am making an application in 3rd edition FP2/ Fp1 SDKs. In one of the screen, I have a Rich Text Editor and a button in front of it (means in the same row). The behavior I want is "in the text editor if the cursor position is at the right most corner of the text, then on pressing right arrow key the focus should move to the button. But what is happening is while doing so the cursor is shifting to the 1st character in the text editor itself."

    For example, if I have written "forum" in the text editor and the cursor position is after "m" then on pressing right arrow key the cursor is moving to "f" rather at this stage I want the text editor to be unfocused and the button to be focused.

    So, I don't want this cycling loop in the text editor. Anybody can help?

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,752

    Re: Problem in handling right arrow key in OfferKeyEventL() for CEikRichTextEditor

    You can check if there are editor flags for preventing this wraparound functionality. If there is not, you could manually filter the event, via checking the cursor position, the document lenght and the actual keypress.

  3. #3
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    India
    Posts
    1,174

    Re: Problem in handling right arrow key in OfferKeyEventL() for CEikRichTextEditor

    You can check if there are editor flags for preventing this wraparound functionality.
    I am unable to find any such flag.

    you could manually filter the event, via checking the cursor position, the document lenght and the actual keypress.
    I am sorry but i forgot to mention in the first post itself that I tried this thing by writing following code

    Code:
    TKeyResponse CHomeHeaderContainer::OfferKeyEventL(const TKeyEvent& aKeyEvent,
    		TEventCode aType)
    	{
    	if (aType != EEventKey)
    		{
    		return EKeyWasNotConsumed;
    		}
    
    	switch (aKeyEvent.iCode)
    		{
    		case EKeyRightArrow:
    			{
    			ChangeControlFocusRight(); // wanted to handle the event here with the conditions of cursor position and text length
    			}
    			break;
                }
    }
    Now while debugging I noticed that whenever the cursor position is behind "m" (in the word "forum") and I press right arrow code then the value of aKeyEvent.iCode is equals to 63496. But if the cursor position is after "m" then on pressing the right arrow key the value of aKeyEvent.iCode is equals to 0. Because of which I am unable to grab the right key event itself in that case.

    Any inputs on this?

  4. #4
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    India
    Posts
    1,174

    Re: Problem in handling right arrow key in OfferKeyEventL() for CEikRichTextEditor

    One more thing which I noticed and could not understand is:

    whenever the cursor position is after "m" then the three events are getting generated: EEventKeyDown, EEventKeyUp and EEventKeyUp (in the same order) rather than EEventKeyDown, EEventKey, and EEventKeyUp (in the same order) as per mentioned by the SDK documents.

    Why is this so?

Similar Threads

  1. Disable arrow key for scrolling in E72
    By nuthon in forum [Archived] Flash Lite on Nokia Devices
    Replies: 9
    Last Post: 2010-06-04, 19:56
  2. Handle Key 'C' key in OfferKeyEventL
    By swapnil_mahajan in forum Symbian
    Replies: 4
    Last Post: 2009-09-20, 10:15
  3. problem with key handling in game
    By bojkar in forum Symbian
    Replies: 3
    Last Post: 2006-01-25, 18:42
  4. handling a long right key left
    By apitoman in forum Symbian
    Replies: 1
    Last Post: 2004-06-07, 10:56
  5. Replies: 2
    Last Post: 2004-04-02, 06:04

Posting Permissions

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