×

Discussion Board

Results 1 to 10 of 10

Thread: Keypress 1.02

  1. #1
    Regular Contributor
    Join Date
    May 2007
    Posts
    56

    Keypress 1.02

    I want to simulate Rigth Key Seleccion. I've signed and installed Keypress 1.02. In my code i put:
    Code:
    from key_modifiers import * 
    from key_codes import * 
    import keypress 
    
    
    keypress.simulate_key(EKeyRightSoftkey,EKeyRightSoftkey)
    I get this error:
    File "c:\resource\key_modifiers.py", line 4
    EModifierAutorepeatable=0x00000001
    ^
    SyntaxError: invalid syntax

    PD: I'm using N73. Thanks

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

    Re: Keypress 1.02

    If you want to simulate pressing the right softkey, you don't need key_modifiers. So take that line out:
    Code:
    from key_codes import * 
    import keypress 
    
    
    keypress.simulate_key(EKeyRightSoftkey,EKeyRightSoftkey)

  3. #3
    Regular Contributor
    Join Date
    May 2007
    Posts
    56

    Re: Keypress 1.02

    Ok, now I don't get error. But app closes python shell, I tried with another key (EKey) and app closes too.

    Any idea?

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

    Re: Keypress 1.02

    Quote Originally Posted by manugarrote View Post
    Ok, now I don't get error. But app closes python shell, I tried with another key (EKey) and app closes too.

    Any idea?
    The first time it closed because you simulated pressing the right softkey, practically telling it to exit. I tried with EKey2 and it worked, it printed "2". So I think it should work for you too.

  5. #5
    Regular Contributor
    Join Date
    May 2007
    Posts
    56

    Re: Keypress 1.02

    Sorry my previous post was wrong, it has to sey:
    Ok, now I don't get error. But app closes python shell, I tried with another key (EKey1) and app closes too.
    Now Itried with this:
    keypress.simulate_key(EKey2,EKey2) and happends the same kill Python Shell.

    PD: first right softkey should close program, second close shell

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

    Re: Keypress 1.02

    Hmm... Apparently the Script Shell has to be signed in order for it to work. I tried with an unsigned one, and like you said, EKey2 makes it close. So sign PythonScriptShell_1_4_3_3rdEd_unsigned_testrange.sis (with all capabilities, just to be sure), uninstall your old Shell and install the new signed one. That should work.

  7. #7
    Regular Contributor
    Join Date
    May 2007
    Posts
    56

    Re: Keypress 1.02

    OK. Now it works but, when I 'am on descktop (see picture) Keypress doen't do anything in other site like notes, calendar... worls perfect, but for the moments it isn't a problem for me.

    I want to make an stand alone app so, if i need to sign python sell, haw I to make any special thing for my stand alone app?? Thanks.

    http://img510.imageshack.us/img510/3...hot0004bn3.jpg

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

    Re: Keypress 1.02

    What do you mean by "special thing"?

  9. #9
    Regular Contributor
    Join Date
    May 2007
    Posts
    56

    Re: Keypress 1.02

    It is necessary sign Python Sell (it's the first time it happend to me). So I asked if have I to do any special thing to my script for build and stand alone sis with ensymble.

    Thanks.

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

    Re: Keypress 1.02

    Yes, you have to sign the standalone app with the SwEvent capability (remember to specify it also when creating the sis file with ensymble).

Similar Threads

  1. simulating keypress
    By selvynz in forum Symbian
    Replies: 28
    Last Post: 2010-08-20, 12:26
  2. Replies: 8
    Last Post: 2009-07-28, 03:38
  3. Replies: 2
    Last Post: 2007-10-18, 00:02
  4. Replies: 1
    Last Post: 2007-07-09, 04:09
  5. about the keypress
    By yahyah_yy in forum Symbian
    Replies: 2
    Last Post: 2004-02-04, 16:34

Posting Permissions

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