×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Regular Contributor
    Join Date
    Mar 2008
    Posts
    151

    Can I use the softkeys / red and green keys?

    In PyS60 I can use the green (EKeyYes) key but I can't use the red/disconnect (EKeyNo) without quitting python. Equally, I can't seem to customise anything using either the left or right soft keys.

    Has anyone found a way to enable the underlying OS to allow PyS60 to use these keys? It would be really useful for my work, in which I'm using the phone to test some reaction times. It seems a bit stupid not to be able to use the red and green keys for yes / no answers - instead I have to train participants to use arbitrary keys (eg 1 or 3) which don't have any intuitive yes/no value.

    Thanks a lot.

    Code:
    def handle_event(event):
        ev = event['keycode']
        #if event['type'] == appuifw.EEventKeyDown:
            #img.clear(BLUE)
        if ev == key_codes.EKeyYes:
            advanceword()
        if ev == key_codes.EKeyLeftSoftkey:
            advanceword()
        if ev == key_codes.EKey9:
            logerror()
        if ev == key_codes.EKeyEdit:
            delete_errors()
        handle_redraw(None)

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

    Re: Can I use the softkeys / red and green keys?

    I believe the envy module will be of some help to you.

  3. #3
    Regular Contributor
    Join Date
    Mar 2008
    Posts
    151

    Re: Can I use the softkeys / red and green keys?

    Thanks - I've read this will prevent the red key from closing python. But will it give me access to the red key to call events? Also, will it free up the soft keys?

  4. #4
    Super Contributor
    Join Date
    Mar 2003
    Location
    Espoo, Finland
    Posts
    976

    Re: Can I use the softkeys / red and green keys?

    RED KEY is a really special case. Short press puts current application to background and opens Application Shell, long press closes network connection.

    I seriously doubt you would be allowed to mess with green and red keys. There are some emergency use cases for mobile phone manufacturers regulating for example making emergency calls. That's why red key goes to appshell, where you can make an emergency phone call - even without SIM card (don't try this at home, unless in real emergency).

    Telling users that red key is "just another key" is not a good thing.

    Cheers,

    --jouni

  5. #5
    Regular Contributor
    Join Date
    Mar 2008
    Posts
    151

    Re: Can I use the softkeys / red and green keys?

    Thanks for the response.

    Actually I already can use the green key, it responds to
    Code:
        if ev == key_codes.EKeyYes:
            advanceword()
    just as it should do.

    That's why I feel like I'm half way there, and it'd be nice to harness the red as well. I'm not suggesting a 'use the red key for all apps' philosophy, but my program would be for my sole experimental use and not for wider distribution. I can see your safety argument makes sense from Nokia's point of view, but I don't think other handsets (eg Sony) are quite so emphatic in their RED = EMERGENCY stance. So I agree that it would be bad practice to roll out loads of apps using the red key for trivial reasons, but for me it would be most useful. And evidently there isn't a restriction on the green key.

    Which failing, how can I bring the left and right soft keys into play? The left seems to be restricted to bringing up menus, and the right seems to quit the app but return to Python. If anyone can help me out I'd be grateful! Thanks
    Last edited by jtullis; 2008-05-07 at 11:40.

  6. #6
    Regular Contributor
    Join Date
    Dec 2007
    Location
    Tempe, AZ
    Posts
    411

    Re: Can I use the softkeys / red and green keys?

    Hi Jtullis
    See for using the left soft key just simply scan it and trigger the function you want to start.

    Code:
    if keyboard.pressed(EScancodeLeftSoftkey):
        appuifw.note(u"1", "Left soft key no menu displayed")
    But for the right soft key i am not too sure about if this thing will work, but i saw this link http://wiki.forum.nokia.com/index.ph...terface_camera
    and maybe you could look into this part
    Code:
    	if((keyboard.pressed(EScancodeRightSoftkey)) and (recording==1)):
    		camera.stop_record()
    		quit()
    Sorry but i couldn't test it myself as my mobile is not functional at the moment....
    Last edited by shubhendra; 2008-05-07 at 15:55.
    IDEAS is all they need but still they think only Genius can give them that.

  7. #7
    Regular Contributor
    Join Date
    Jan 2004
    Location
    Helsinki
    Posts
    376

    Re: Can I use the softkeys / red and green keys?

    Quote Originally Posted by JOM View Post
    Telling users that red key is "just another key" is not a good thing.
    You still need to catch the keypress if you want to put your application background instead of closing it. All default Nokia apps seem to do this, but it's not the default behavior for 3rd party apps.
    Mikko Ohtamaa

    http://mfabrik.com
    http://blog.mfabrik.com

Similar Threads

  1. End(red) Button in HandleWsEventL()
    By ezchip in forum Symbian
    Replies: 48
    Last Post: 2009-04-28, 11:46
  2. Capturing E65 special keys
    By raul.cicero in forum Symbian User Interface
    Replies: 1
    Last Post: 2007-11-06, 14:28
  3. Keys? is it already supported?
    By Zen13546 in forum Symbian
    Replies: 3
    Last Post: 2005-04-21, 12:06
  4. Replies: 0
    Last Post: 2005-01-12, 17:30
  5. how to get red() green() and blue() values from TRgb
    By pengox in forum Symbian User Interface
    Replies: 1
    Last Post: 2004-03-01, 22:12

Posting Permissions

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