×

Discussion Board

Results 1 to 15 of 19

Hybrid View

  1. #1
    Regular Contributor
    Join Date
    Feb 2008
    Location
    Pune, India
    Posts
    340

    Key(s) Simulation "Globally"

    Hello Folks,

    I want to simulate all the keys on the keypad for the Nokia 73 (basically S603rd edition) globally. I am not able to simulate any key other than the "RED" key. The following code works,

    Code:
    RWsSession wsSession = CCoeEnv::Static()->WsSession();
    TKeyEvent keyEvent;
    keyEvent.iCode = EKeyNo;  //member of TKeyCode
    keyEvent.iScanCode = EStdKeyNo;
    keyEvent.iModifiers = 0;
    keyEvent.iRepeats = 0;
    wsSession.SimulateKeyEvent(keyEvent);
    wsSession.Flush();
    Is it not possible to simulate all the keys? If it is, then can someone point me towards a "sane" mapping table for the keys?
    For e.g. KEY: Numeric Key 1 ScanCode: ABC Code = XYZ

    Thanks in advance.
    Regards,
    Sainagakishore Srikantham (Kishore)

    Don't Hope, KNOW!!! ---------- Visit me at http://ssnkishore.blogspot.com ----------

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

    Re: Key(s) Simulation "Globally"

    Symbian OS v9.1 » Symbian OS reference » C++ component reference » Base E32 » TStdScanCode

  3. #3
    Super Contributor
    Join Date
    Jun 2006
    Location
    India
    Posts
    3,037

    Re: Key(s) Simulation "Globally"

    Hi,

    Try to debug your application and put a break point in OfferKeyEventL and when you press any key you can find the keycode in debug window.
    Use [URL="http://qt.nokia.com/products/qt-quick/"]Qt-Quick[/URL] to make your application UI more attractive.

    [URL="http://store.ovi.com/content/271896"]http://store.ovi.com/content/271896[/URL] | [URL="http://store.ovi.com/content/276199"]http://store.ovi.com/content/276199[/URL] |[URL="http://store.ovi.com/content/276202"] http://store.ovi.com/content/276202[/URL] | [URL="http://store.ovi.com/content/280827"]http://store.ovi.com/content/280827[/URL]

  4. #4
    Regular Contributor
    Join Date
    Feb 2008
    Location
    Pune, India
    Posts
    340

    Re: Key(s) Simulation "Globally"

    Quote Originally Posted by kkrish View Post
    Hi,

    Try to debug your application and put a break point in OfferKeyEventL and when you press any key you can find the keycode in debug window.
    Thanks for the reply Krish!

    I have the scancodes I want to simulate. For e.g. the scan code printed when I press the "1" key on the numeric keypad is 49, while the scan code for the same given in e32keys.h is EStdKeyNkp1. Secondly, there is no corresponding value to fill in the iCode member of the TKeyEvent.

    Lastly, the Symbian website is down
    Regards,
    Sainagakishore Srikantham (Kishore)

    Don't Hope, KNOW!!! ---------- Visit me at http://ssnkishore.blogspot.com ----------

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

    Re: Key(s) Simulation "Globally"

    the link i have given is from SDK help.

  6. #6
    Registered User
    Join Date
    Jun 2006
    Location
    India
    Posts
    1,043

    Re: Key(s) Simulation "Globally"

    Hi,
    Implement HandleWsEventL() in your AppUi and when you will debug your application keeping a breakpoint you can get all the codes for all of the keys in numeric keypad. Anyways first check the SDK help link which skumar_rao has provided. You can get that in your SDK help no need for going through web link.
    Maximus
    S60 Developer
    Impossible is nothing

  7. #7
    Registered User
    Join Date
    Dec 2005
    Posts
    1,236

    Re: Key(s) Simulation "Globally"

    Quote Originally Posted by ssn.kishore View Post


    Thanks for the reply Krish!

    I have the scancodes I want to simulate. For e.g. the scan code printed when I press the "1" key on the numeric keypad is 49, while the scan code for the same given in e32keys.h is EStdKeyNkp1. Secondly, there is no corresponding value to fill in the iCode member of the TKeyEvent.

    Lastly, the Symbian website is down
    Hi,

    Lately even I have noticed that iCode is always zero for all the key events. Any one knows anything about this ?
    Regards,
    Sriky

  8. #8
    Super Contributor
    Join Date
    Nov 2004
    Location
    Wiltshire, UK
    Posts
    3,644

    Re: Key(s) Simulation "Globally"

    If the TEventCode code is EEventKeyUp or EEventKeyDown then the iCode will be 0
    Download Symbian OS now! [url]http://developer.symbian.org[/url]

  9. #9
    Registered User
    Join Date
    Dec 2005
    Posts
    1,236

    Re: Key(s) Simulation "Globally"

    Hi Paul,

    I was debugging and I have noticed that for all the three events types the iCode was zero anyways I will debug once again and post the result.
    Regards,
    Sriky

  10. #10
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,751

    Re: Key(s) Simulation "Globally"

    It is OK that iCode is zero for EEventKeyDown and EEventKeyUp. However it should be non-zero for EEventKey. Where have you tested that?

  11. #11
    Regular Contributor
    Join Date
    Feb 2008
    Location
    Pune, India
    Posts
    340

    Re: Key(s) Simulation "Globally"

    Code:
    RWsSession wsSession = CCoeEnv::Static()->WsSession();
    TKeyEvent keyEvent;
    keyEvent.iCode = 49;  //member of TKeyCode
    keyEvent.iScanCode = 49;
    keyEvent.iModifiers = 1;
    keyEvent.iRepeats = 0;
    wsSession.SimulateKeyEvent(keyEvent);
    wsSession.Flush();
    Why doesn't the above code simulate the "1" numeric key?

    49 is the scan code and iCode for it I received in the OfferKeyEventL() function of my View class. Am I doing something wrong?

    @Yogpan, the HandleWsSessionEventL() example given on Wiki doesn't seem to work for me
    Regards,
    Sainagakishore Srikantham (Kishore)

    Don't Hope, KNOW!!! ---------- Visit me at http://ssnkishore.blogspot.com ----------

Similar Threads

  1. Nokia N81 soft keys
    By ronanocie in forum Mobile Java General
    Replies: 7
    Last Post: 2009-03-30, 12:39
  2. Can I use the softkeys / red and green keys?
    By jtullis in forum Symbian
    Replies: 6
    Last Post: 2008-05-11, 21:44
  3. N93 - using external display and keys
    By gotzinger in forum Symbian
    Replies: 4
    Last Post: 2008-05-07, 18:15
  4. midlet program navigation keys
    By sebiskaa in forum Mobile Java General
    Replies: 2
    Last Post: 2008-05-07, 14:58
  5. keys simulation not working.
    By pistha in forum Symbian
    Replies: 2
    Last Post: 2007-04-26, 11:39

Posting Permissions

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