| Reply | « Previous Thread | Next Thread » |
|
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)
|
|
Join Date: Oct 2007
Posts: 2,845
Location: Deva, Romania
Offline
Forum Nokia Champion
|
|
I believe the envy module will be of some help to you.
|
|
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?
|
|
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 |
|
Thanks for the response.
Actually I already can use the green key, it responds to Code:
if ev == key_codes.EKeyYes:
advanceword()
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.
|
|
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")
and maybe you could look into this part Code:
if((keyboard.pressed(EScancodeRightSoftkey)) and (recording==1)): camera.stop_record() quit() ![]() 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.
|
| shubhendra |
| View Public Profile |
| Find all posts by shubhendra |
|
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 | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Rate This Thread | |
| 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 |