×

Discussion Board

Results 1 to 15 of 15
  1. #1
    Registered User
    Join Date
    Feb 2006
    Posts
    22

    binding EKeyLeftSoftkey not working

    Dear all,
    I am trying to bind the left soft key using Pys60 1.9.6.
    Here the code:

    Code:
    import appuifw, key_codes
    
    c=appuifw.Canvas()
    appuifw.app.body=c
    
    def onLEFT():
        print "Left Soft Key pressed"
        
    c.bind(key_codes.EKeyLeftSoftkey, onLEFT)
    When I press the key nothing happens.
    Any idea?

    Thanks for help!

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

    Re: binding EKeyLeftSoftkey not working

    Quote Originally Posted by giaperrucci View Post
    Dear all,
    I am trying to bind the left soft key using Pys60 1.9.6.
    Here the code:

    Code:
    import appuifw, key_codes
    
    c=appuifw.Canvas()
    appuifw.app.body=c
    
    def onLEFT():
        print "Left Soft Key pressed"
        
    c.bind(key_codes.EKeyLeftSoftkey, onLEFT)
    When I press the key nothing happens.
    Any idea?

    Thanks for help!
    hello giaperucci

    i guess you are not creating a lock in your program which will have sufficient time to display your binding. You can have a look at this wiki article for more details.

    Cheers,
    Gaba88

  3. #3
    Registered User
    Join Date
    Feb 2006
    Posts
    22

    Re: binding EKeyLeftSoftkey not working

    Thank you for the answer Gaba.
    I tried it out with BT console and the lock is not necessary.
    Anyhow, I tried the code in the article you pointed me at (just binding the left soft key instead), but it doesn't react as well.
    I am using an N95 8 gb.

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

    Re: binding EKeyLeftSoftkey not working

    Quote Originally Posted by giaperrucci View Post
    Thank you for the answer Gaba.
    I tried it out with BT console and the lock is not necessary.
    Anyhow, I tried the code in the article you pointed me at (just binding the left soft key instead), but it doesn't react as well.
    I am using an N95 8 gb.
    hello giaperucci

    thats strange, tell me what errors you get?? and i hope you have code for the Leftsoftkey, please refer the API documentation of all codes.

    Regards

  5. #5
    Nokia Developer Moderator
    Join Date
    Oct 2007
    Location
    Deva, Romania
    Posts
    3,471

    Re: binding EKeyLeftSoftkey not working

    Quote Originally Posted by gaba88 View Post
    thats strange, tell me what errors you get??
    It's all in the first post

    Quote Originally Posted by giaperrucci View Post
    When I press the key nothing happens.

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

    Re: binding EKeyLeftSoftkey not working

    thanks bogdan for pointing towards that.

    Maybe the problem with capabilities I guess using keys require a special Caps.

    @giaperucci which scriptshell you are using in PyS60 1.9.6.

  7. #7
    Nokia Developer Moderator
    Join Date
    Oct 2007
    Location
    Deva, Romania
    Posts
    3,471

    Re: binding EKeyLeftSoftkey not working

    giaperrucci, excuse me for asking a silly question, but as the body of the application is a canvas it's normal for it not to show anything if you use the print statement. Did you exit the console in order to see the output?

  8. #8
    Regular Contributor
    Join Date
    Apr 2009
    Posts
    65

    Thumbs down Re: binding EKeyLeftSoftkey not working

    Quote Originally Posted by giaperrucci View Post
    Dear all,
    I am trying to bind the left soft key using Pys60 1.9.6.
    Here the code:

    Code:
    import appuifw, key_codes
    
    c=appuifw.Canvas()
    appuifw.app.body=c
    def onLEFT():
        print "Left Soft Key pressed"
        
    c.bind(key_codes.EKeyLeftSoftkey, onLEFT)
    When I press the key nothing happens.
    Any idea?

    Thanks for help!

    This is a bug! It doesn't work in the emulator as well. Tried on 1.4.5 and 1.9.6 both.

    Could someone register as a bug? Any official word from the team- Mahesh or Ashwin?
    --NirpSis

    http://sites.google.com/site/nirpsis/
    http://nirpsis.blogspot.com/

  9. #9
    Nokia Developer Moderator
    Join Date
    Oct 2007
    Location
    Deva, Romania
    Posts
    3,471

    Re: binding EKeyLeftSoftkey not working

    Quote Originally Posted by nirpsis View Post
    This is a bug! It doesn't work in the emulator as well. Tried on 1.4.5 and 1.9.6 both.

    Could someone register as a bug? Any official word from the team- Mahesh or Ashwin?
    If you really believe it's a bug, you can file a report here. But let's wait for some more opinions. I don't think it's a bug since it works normally on my N97.

    And like I said in my previous post, the print statement won't display anything on a Canvas

  10. #10
    Regular Contributor
    Join Date
    Oct 2007
    Posts
    114

    Re: binding EKeyLeftSoftkey not working

    Quote Originally Posted by nirpsis View Post
    This is a bug! It doesn't work in the emulator as well. Tried on 1.4.5 and 1.9.6 both.

    Could someone register as a bug? Any official word from the team- Mahesh or Ashwin?
    Try using appuifw.note instead of print in the callback.
    import antigravity

  11. #11
    Regular Contributor
    Join Date
    Apr 2009
    Posts
    65

    Re: binding EKeyLeftSoftkey not working

    Quote Originally Posted by bogdan.galiceanu View Post
    If you really believe it's a bug, you can file a report here. But let's wait for some more opinions. I don't think it's a bug since it works normally on my N97.

    And like I said in my previous post, the print statement won't display anything on a Canvas
    Thanks for the tip, Bogdan

    Does this code work for you? I had tried that on the emulator.

    Code:
    # import modules
    import appuifw, e32, key_codes 
    # define functions to show notifications
    def up():
        appuifw.note(u"Arrow up was pressed")
        
    def two():
        appuifw.note(u"Key 2 was pressed")   
     
    def quit():
        app_lock.signal()
    # Create Canvas object
    canvas = appuifw.Canvas()
    appuifw.app.body = canvas
    # Bind keys
    canvas.bind(key_codes.EKeyLeftSoftkey, up)
    canvas.bind(key_codes.EKey2, two)
    # Exit handling
    appuifw.app.exit_key_handler = quit
    app_lock = e32.Ao_lock()
    app_lock.wait()
    Quote Originally Posted by ashwinurao View Post
    Try using appuifw.note instead of print in the callback.
    Thanks Ashwin, I had just done that earlier as well. Didn't use canvas earlier, used note

    The only thing is I tried it on the emulator S60 3rd Edition FP2. If it doesn't work on it, it is a BUG! Will report it if no solution is presented
    --NirpSis

    http://sites.google.com/site/nirpsis/
    http://nirpsis.blogspot.com/

  12. #12
    Nokia Developer Moderator
    Join Date
    Oct 2007
    Location
    Deva, Romania
    Posts
    3,471

    Re: binding EKeyLeftSoftkey not working

    The code you posted works on my E90 when pressing the 2 key, but not when pressing the left softkey. I assume this is because the E90, being a querty device, needs to have a different keycode specified. Anyway, when I changed it to EKeyUpArrow it worked. So yes, it's safe to say this isn't a bug on real phones. Don't know about emulators though, I can't test it on one at the moment.
    Last edited by bogdan.galiceanu; 2009-07-09 at 08:52.

  13. #13
    Regular Contributor
    Join Date
    Oct 2007
    Posts
    114

    Re: binding EKeyLeftSoftkey not working

    Please note this statement in the documentation : "There is no way to prevent the standard action of the Hang-up key, the Menu key, the Power key or the Voice tags key from taking place". So you cannot bind these keys at all.
    import antigravity

  14. #14
    Regular Contributor
    Join Date
    Apr 2009
    Posts
    65

    Re: binding EKeyLeftSoftkey not working

    Ashwin, That doesn't include the Left soft key? Does it?

    Bogdan, I tested it on N95 too. It doesn't work as well. The key 2 works.

    Still wondering if it is supposed to work or not
    --NirpSis

    http://sites.google.com/site/nirpsis/
    http://nirpsis.blogspot.com/

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

    Re: binding EKeyLeftSoftkey not working

    Quote Originally Posted by nirpsis View Post
    Ashwin, That doesn't include the Left soft key? Does it?

    Bogdan, I tested it on N95 too. It doesn't work as well. The key 2 works.

    Still wondering if it is supposed to work or not
    hello nirpsis

    i also checked the script in my N96 the key2 worked very fine me for me, but the leftsoftkey is not working here two.

    Have you checked this in the S60 3rdFP2 emulator?? At present i am not in a situation to check that in emulator.

    Regards
    Gargi

Similar Threads

  1. CAknMessageQueryDialog not working on the Target E61
    By symbians60 in forum Symbian User Interface
    Replies: 4
    Last Post: 2008-04-23, 20:15
  2. No rule to male target
    By arayappan_it in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 4
    Last Post: 2008-02-28, 10:49
  3. Working on GSM, Not working on CDMA
    By aminuddin09 in forum Mobile Java Networking & Messaging & Security
    Replies: 0
    Last Post: 2007-03-21, 07:07
  4. Program suddenly not working - doesn't recognise hardware
    By luciadoll in forum Bluetooth Technology
    Replies: 0
    Last Post: 2006-12-10, 01:54

Posting Permissions

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