You Are Here:

Community: Developer Discussion Boards

#1 Old Can I use the softkeys / red and green keys? - 2008-05-06, 15:07

Join Date: Mar 2008
Posts: 127
jtullis
Offline
Regular Contributor
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)
Reply With Quote

#2 Old Re: Can I use the softkeys / red and green keys? - 2008-05-06, 15:33

Join Date: Oct 2007
Posts: 2,845
Location: Deva, Romania
bogdan.galiceanu's Avatar
bogdan.galiceanu
Offline
Forum Nokia Champion
I believe the envy module will be of some help to you.
Reply With Quote

#3 Old Re: Can I use the softkeys / red and green keys? - 2008-05-06, 18:10

Join Date: Mar 2008
Posts: 127
jtullis
Offline
Regular Contributor
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?
Reply With Quote

#4 Old Re: Can I use the softkeys / red and green keys? - 2008-05-07, 11:41

Join Date: Mar 2003
Posts: 937
Location: Espoo, Finland
JOM's Avatar
JOM
Offline
Forum Nokia Champion
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
Reply With Quote

#5 Old Re: Can I use the softkeys / red and green keys? - 2008-05-07, 12:02

Join Date: Mar 2008
Posts: 127
jtullis
Offline
Regular Contributor
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 12:40.
Reply With Quote

#6 Old Re: Can I use the softkeys / red and green keys? - 2008-05-07, 16:46

Join Date: Dec 2007
Posts: 409
Location: Tempe, AZ
Send a message via Yahoo to shubhendra Send a message via Skype™ to shubhendra
shubhendra's Avatar
shubhendra
Offline
Forum Nokia Champion
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....


IDEAS is all they need but still they think only Genius can give them that.
Last edited by shubhendra : 2008-05-07 at 16:55.
Reply With Quote

#7 Old Re: Can I use the softkeys / red and green keys? - 2008-05-11, 22:44

Join Date: Jan 2004
Posts: 369
Location: Helsinki
Send a message via Skype™ to miohtama
miohtama's Avatar
miohtama
Offline
Regular Contributor
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
Twinapex Research
http://www.twinapex.com
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
End(red) Button in HandleWsEventL() ezchip General Symbian C++ 48 2009-04-28 12:46
Capturing E65 special keys raul.cicero Symbian User Interface 1 2007-11-06 15:28
Keys? is it already supported? Zen13546 Python 3 2005-04-21 13:06
How to disable the softkey's and the green + red one HA_de_Z General Symbian C++ 0 2005-01-12 18:30
how to get red() green() and blue() values from TRgb pengox Symbian User Interface 1 2004-03-01 23:12

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia