×

Discussion Board

Results 1 to 9 of 9

Hybrid View

  1. #1
    Registered User
    Join Date
    Oct 2004
    Posts
    6

    Why SimulateKeyEvent() cannot simulate the Application key press and End key press

    Hi, I'm try to simulate key press in my application.
    The following is part of my code .

    /**********************/
    void CMyAppkey::SimulateKeyEvent(TInt aCode)
    {
    TKeyEvent aKeyEvent;
    aKeyEvent.iCode = aCode;
    aKeyEvent.iScanCode = 0;
    aKeyEvent.iModifiers = 0;
    aKeyEvent.iRepeats = 0;
    iWsSession.SimulateKeyEvent(aKeyEvent);
    iWsSession.Flush();
    }
    /**********************/

    By testing this, I can simulate all the numeric keys and arrow keys.
    for instance:
    iMyAppkey->SimulateKeyEvent(48);// for number 0
    iMyAppkey->SimulateKeyEvent(63495);// for left arrow key
    iMyAppkey->SimulateKeyEvent(8);// for clear key
    iMyAppkey->SimulateKeyEvent(42);// for star key
    iMyAppkey->SimulateKeyEvent(63557);// for selection key
    iMyAppkey->SimulateKeyEvent(63555);// for right functional key

    but I can not simulate press Application key and End key.
    I tried like this:
    iMyAppkey->SimulateKeyEvent(63570);// for Apps key
    iMyAppkey->SimulateKeyEvent(63587);// for End key

    Besides invoking SimulateKeyEvent(), I also tried the following code:
    /**********************/
    void CMyAppkey::SimulateRawEvent(TInt aScanCode)
    {
    TRawEvent aRawEvent;
    aRawEvent.Set(TRawEvent::EKeyDown,aScanCode);
    iWsSession.SimulateRawEvent(aRawEvent);
    aRawEvent.Set(TRawEvent::EKeyUp,aScanCode);
    iWsSession.SimulateRawEvent(aRawEvent);
    iWsSession.Flush();
    }
    /**********************/

    iMyAppkey->SimulateRawEvent(180);// for Apps key
    iMyAppkey->SimulateRawEvent(197);// for End key

    But it doesn't work either!

    Can anyone help me to fix it?
    thank you.

  2. #2
    Registered User
    Join Date
    Apr 2005
    Location
    Barcelona
    Posts
    1,678

    Re: Why SimulateKeyEvent() cannot simulate the Application key press and End key press

    3rd edition? Do you have the corresponding capability?

  3. #3
    Registered User
    Join Date
    Oct 2004
    Posts
    6

    Re: Why SimulateKeyEvent() cannot simulate the Application key press and End key pres

    I'm on 2.6 and 2.8.
    Now the End key can be simulated .
    But the Apps key is still not work.

  4. #4
    Registered User
    Join Date
    Apr 2005
    Location
    Barcelona
    Posts
    1,678

    Re: Why SimulateKeyEvent() cannot simulate the Application key press and End key pres

    Use constants instead of magic numbers (see e32keys.h for instance). App's key code is EKeyApplication0

  5. #5
    Registered User
    Join Date
    Sep 2007
    Posts
    17

    Re: Why SimulateKeyEvent() cannot simulate the Application key press and End key pres

    why when i used the SimulateRawEvent or SimulateKeyEvent method, i got the Panic WSER 66 error? Can you help me ?

  6. #6
    Registered User
    Join Date
    Dec 2008
    Posts
    2

    Re: Why SimulateKeyEvent() cannot simulate the Application key press and End key pres

    hi all,
    can any one tel me how to simulate the key press events in BREW??
    how to add the key events to the event queue??(i know it is not the right forum to ask about BREW but still im posting). If any one knows brew please let me know the procedure for it.

    Thanks in advance,
    Rajeshwari

  7. #7
    Super Contributor
    Join Date
    Jul 2008
    Location
    Chennai,India
    Posts
    889

    Re: Why SimulateKeyEvent() cannot simulate the Application key press and End key pres


  8. #8
    Super Contributor
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968

    Re: Why SimulateKeyEvent() cannot simulate the Application key press and End key pres

    ha ha that is not a BREW Programming Site .. that is Drinking Brew Preparation site.
    Last edited by skumar_rao; 2009-01-24 at 07:10.

  9. #9
    Super Contributor
    Join Date
    Jul 2008
    Location
    Chennai,India
    Posts
    889

    Re: Why SimulateKeyEvent() cannot simulate the Application key press and End key pres

    OOps...sorry sorry...
    Juz trusted google search...but it's too intelligent....

Similar Threads

  1. saving game status after press the red end button
    By ayanir in forum Mobile Java General
    Replies: 0
    Last Post: 2006-01-16, 16:07
  2. CloseSTDLIB and emulator waiting for key press
    By domestique in forum Symbian
    Replies: 0
    Last Post: 2003-12-23, 21:13

Posting Permissions

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