×

Discussion Board

Page 1 of 5 12345 LastLast
Results 1 to 15 of 75
  1. #1
    Registered User
    Join Date
    Jun 2005
    Posts
    386

    [Announce] keypress module 1.0.5

    Hi,

    --- EDIT ---
    Version 1.0.5 has been replaced by 1.0.6. Post changed accordingly.
    --- /EDIT ---

    I've updated the keypress module to version 1.0.6.

    What's new?

    1.0.6
    * added send_raw_event() function which sends a raw event "behind the window server"; this lets you simulate the application key, red key or number keys on the standby screen - all this don't work using other functions

    1.0.5
    * unified simulate_key() and simulate_key_mod() functions. They are just different names for the same function now; the modifiers parameter is optional now
    * added simulate_event() function which simulates a single EEventKeyUp, EEventKeyDown or EEventKey event, with support for repeats parameter
    * rewritten everything based on uikludges module (it had a nice batch files for building and a nicely laid out sources)

    Currently there are only 3rd edition builds.

    Download

    keypress_1.0.6_unsigned_testrange.sis
    keypress_1.0.6_src.zip

    Installation

    IMPORTANT! Uninstall old (pre-1.0.5) version before installing this one. This is really needed as this one uses a different UID (auto-generated by Ensymble).

    Download the sis file and sign it using Open Signed Online for your phone.

    Install the signed SIS file.

    Make sure your Python Shell or Ped or some other standalone application you're using the keypress module in is also signed.

    All exported functions

    simulate_key(keycode, scancode [, modifiers])
    Simulates a keypress. For keycode, scancode and modifiers, use constants from key_codes module.

    simulate_event(event, keycode, scancode [, modifiers [, repeats]])
    Simulates a single key-down, key or key-up event. The event parameter is either EEventKeyDown, EEventKey or EEventKeyUp defined in either appuifw or keypress module itself. The keycode, scancode and modifiers params are the same as for the simulate_key(). The repeats i a number of generated auto repeats (an integer).

    send_raw_event(event [, param1 [, param2]])
    Sends one of the raw events defined in the keypress module (check out c:\resource\keypress.py after installation). Most useful are EKeyUp and EKeyDown. Events with one or two params are supported, the key events use one param which is a scancode of the key (EStdKey*** or EScancode*** defined in key_codes).

    Functions kept for compatibility:

    simulate_key_mod(keycode, scancode [, modifiers])
    Same as simulate_key().

    simulate_keyMenu()
    Simulates right softkey press.
    Last edited by y.a.k; 2008-07-16 at 12:40. Reason: Updated to 1.0.6

  2. #2
    Nokia Developer Champion
    Join Date
    Feb 2008
    Location
    Ahmedabad, Gujarat, India
    Posts
    3,852

    Re: [Announce] keypress module 1.0.5

    Hi y.a.k
    great work man.
    hope youwill develop this for a 2nd edition device also
    but congrats for this great work.

  3. #3
    Regular Contributor
    Join Date
    Mar 2003
    Posts
    115

    Re: [Announce] keypress module 1.0.5

    Great work mate and will test it now

  4. #4
    Registered User
    Join Date
    Feb 2005
    Location
    Belgium (Europe)
    Posts
    1,352

    Re: [Announce] keypress module 1.0.5

    Hello Arkadius :-)

    Thanks for updating this useful module ( first created by students and after updated by me and now by you

    BR
    Cyke64
    pys60 1.4.5 and 2.0.0, pygame, PyS60 CE on E90 and 5800 !

    Find my pys60 extension modules on cyke64.googlepages.com

  5. #5
    Registered User
    Join Date
    Jun 2005
    Posts
    386

    Re: [Announce] keypress module 1.0.5

    Hi Cyke64,

    Thanks.

    @all

    It would be great if some of you could test, at least the old functions so that I know it is fully compatible with previous versions (remember, this version is rewritten from scratch).

    Please do so and report here.
    Thank you.

  6. #6
    Registered User
    Join Date
    Jul 2008
    Posts
    10

    Re: [Announce] keypress module 1.0.5

    Thank you for this update.

    Is it possible to modify this module in a way that the keypresses are executed if the screensaver is active? I expect that the screensaver will be inactive after executing keypress.simulate_key(EKeySelect, EKeySelect)...

  7. #7
    Registered User
    Join Date
    Jun 2005
    Posts
    386

    Re: [Announce] keypress module 1.0.5

    Quote Originally Posted by mcoduro View Post
    Thank you for this update.

    Is it possible to modify this module in a way that the keypresses are executed if the screensaver is active? I expect that the screensaver will be inactive after executing keypress.simulate_key(EKeySelect, EKeySelect)...
    Try using e32.reset_inactivity() before simulating the key. That should do the trick.

  8. #8
    Registered User
    Join Date
    Jun 2005
    Posts
    386

    Re: [Announce] keypress module 1.0.5

    I'm releasing a new version, 1.0.6, which includes a new function - send_raw_event - allowing to simulate the application key, red key or entering numbers on the standby screen.

    Check out the first post.

  9. #9
    Super Contributor
    Join Date
    Feb 2008
    Location
    Belo Horizonte, Brazil
    Posts
    744

    Re: [Announce] keypress module 1.0.5

    How could I simulate the left softkey?

  10. #10
    Super Contributor
    Join Date
    Oct 2007
    Location
    Deva, Romania
    Posts
    3,471

    Re: [Announce] keypress module 1.0.5

    Quote Originally Posted by Rafael T. View Post
    How could I simulate the left softkey?
    Code:
    import keypress
    from key_codes import *
    
    keypress.simulate_key(EKeyLeftSoftkey,EKeyLeftSoftkey)
    Oh and since I didn't get the chance to say this yet, thanks and congratulations Arkadiusz for updating this very useful module.

  11. #11
    Registered User
    Join Date
    Jun 2005
    Posts
    386

    Re: [Announce] keypress module 1.0.5

    Actually, the second parameter of simulate_key is a scancode.

    Code:
    import keypress
    from key_codes import *
    
    keypress.simulate_key(EKeyLeftSoftkey, EScancodeLeftSoftkey)
    It is true that some keys use the save values for keycodes and scancodes but the left softkey isn't one of them. Using the same value would probably work in some apps but could not in the others.

    And thanks for your appreciation, Bogdan, you're welcome.

  12. #12
    Super Contributor
    Join Date
    Feb 2008
    Location
    Belo Horizonte, Brazil
    Posts
    744

    Re: [Announce] keypress module 1.0.5

    Thanks bodgan and y.a.k for the help.

    I have a suggestion for a new module in python. It should control the status of the calls. In C++ is not difficult to do this, so I think it's pretty possible. When I have some time i'll try to do it. But it is a suggestion ... y.a.k, you're a great developer, if you want to try ... it would be a great module for me and I think for all of us

  13. #13
    Registered User
    Join Date
    Nov 2006
    Posts
    568

    Re: [Announce] keypress module 1.0.5

    Quote Originally Posted by y.a.k View Post
    I'm releasing a new version, 1.0.6, which includes a new function - send_raw_event - allowing to simulate the application key, red key or entering numbers on the standby screen.

    Check out the first post.
    Could you please be a bit more specific on how to send the "red" key? I cannot make this run...

  14. #14
    Registered User
    Join Date
    Jun 2005
    Posts
    386

    Re: [Announce] keypress module 1.0.5

    Quote Originally Posted by neil.young View Post
    Could you please be a bit more specific on how to send the "red" key? I cannot make this run...
    Try this:
    Code:
    import keypress
    from key_codes import *
    keypress.send_raw_event(keypress.EKeyDown, EStdKeyNo)
    keypress.send_raw_event(keypress.EKeyUp, EStdKeyNo)
    Last edited by y.a.k; 2008-10-07 at 07:36. Reason: The original code was buggy.

  15. #15
    Registered User
    Join Date
    Nov 2006
    Posts
    568

    Re: [Announce] keypress module 1.0.5

    Hi yak,

    thanks. Looks good, but doesn't work in this scenario:

    Code:
    import telephone
    import e32
    from appuifw import *
    
    from key_codes import * 
    import keypress 
    
    
    def cb(callstate):
    	print "Callstate change", callstate
    	if (callstate[0] == telephone.EStatusRinging):
    		e32.reset_inactivity() 
    		keypress.send_raw_event(keypress.EKeyDown, EKeyNo)
    		keypress.send_raw_event(keypress.EKeyUp, EKeyNo)
    		print "Red key pressed"
    	
    
    
    lock = e32.Ao_lock()
    app.exit_key_handler = lock.signal
    
    telephone.call_state(cb)
    telephone.incoming_call()
    lock.wait()
    The "Red key pressed" trace is visible in ScriptShell, but the call isn't hung up (Nokia N82)

    Regards

Similar Threads

  1. Replies: 8
    Last Post: 2009-07-28, 03:38
  2. Replies: 2
    Last Post: 2008-07-10, 08:02
  3. Replies: 2
    Last Post: 2007-10-18, 00:02
  4. Carbide.j 1.5 and Netbeans 5.5 beta 2
    By ovjo12 in forum Mobile Java Tools & SDKs
    Replies: 5
    Last Post: 2007-06-11, 05:43
  5. [announce] Enhanced Graphics module
    By GameDude in forum Symbian
    Replies: 10
    Last Post: 2007-03-18, 19:44

Posting Permissions

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