×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Oct 2006
    Posts
    13

    Key capture in form

    hi,

    I have created a 3 forms in a view.
    Now i want to capture the the key press in each of this form.

    If I write code below ,

    TKeyResponse CMultiViewsGenericForm::OfferKeyEventL(const TKeyEvent &aKeyEvent, TEventCode aType)

    Then this code stops scolling in each form.

    please tell me the solution. Its urgent.
    Thank you.

  2. #2
    Registered User
    Join Date
    Jul 2005
    Location
    Bengaluru, India
    Posts
    747

    Re: Key capture in form

    I hope this code will help you:

    Code:
    TKeyResponse CMultiViewsGenericForm::OfferKeyEventL(const TKeyEvent &aKeyEvent, TEventCode aType)
    	{
    	// ...
    	return CAknForm::OfferKeyEventL( aKeyEvent, aType );
    	//...
    	}

  3. #3
    Registered User
    Join Date
    Oct 2006
    Posts
    13

    Re: Key capture in form

    hi,
    Thank a lot for you reply.

    But i want to perforn some action on keypress. Like i want to send a string via bluetooth on key press...

    So wheere should i write code for that.

    For example my current code is as below:

    TKeyResponse CMultiViewsGenericForm::OfferKeyEventL(const TKeyEvent &aKeyEvent, TEventCode aType)
    {
    switch(aKeyEvent.iCode)
    {

    case '1':
    {
    fAppUi->BluetoothHandler()->viewNo=fAppUi->CurrentView;
    fAppUi->BluetoothHandler()->RequestKey1();
    return EKeyWasConsumed ;
    break;
    }
    default:
    {
    return EKeyWasNotConsumed;
    break;
    }
    }
    }

    Thank you.

  4. #4
    Registered User
    Join Date
    Jul 2005
    Location
    Bengaluru, India
    Posts
    747

    Re: Key capture in form

    What about putting the code which I've given in the default:?

  5. #5
    Registered User
    Join Date
    Oct 2006
    Posts
    13

    Re: Key capture in form

    hi,
    Thanks a lot
    Yesss !!!
    It worked..
    Thanks a lot once again :)

  6. #6
    Registered User
    Join Date
    Oct 2006
    Posts
    13

    Re: Key capture in form

    hi,

    One more doubt.
    I have 3 pages in the form.
    How will I come to know that which page is in focus?

    Because if page1 is in focus and key 1 is pressed then i want to write string "page1Key1" similarly for page 2 "page2key1" and "page3key1"

    Can you please tell me how should I do this?
    Thank you

Similar Threads

  1. second form not getting key events
    By krsunil in forum Symbian User Interface
    Replies: 3
    Last Post: 2008-12-10, 10:29
  2. Replies: 0
    Last Post: 2005-08-08, 04:42
  3. 7710: Key Capture
    By silverparasol in forum Symbian
    Replies: 1
    Last Post: 2005-07-08, 09:11
  4. Capture the handset key
    By BigFatGangsta in forum Symbian
    Replies: 2
    Last Post: 2004-02-10, 08:56
  5. How to capture key press and key release events in series 60 for 7650?
    By varshajohn in forum Symbian User Interface
    Replies: 2
    Last Post: 2003-04-30, 13:03

Posting Permissions

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