| Reply | « Previous Thread | Next Thread » |
|
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)
Any idea? Thanks for help! |
| giaperrucci |
| View Public Profile |
| Find all posts by giaperrucci |
|
Join Date: Feb 2008
Posts: 2,543
Location: Bhavnagar, Gujarat, India
gaba88
Online
Forum Nokia Champion
|
|
|
Quote:
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 Gargi Das- http://gargidas.blogsot.com Forum Nokia Python Wiki Learn Python at http://mobapps.org/PyS60 |
|
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. |
| giaperrucci |
| View Public Profile |
| Find all posts by giaperrucci |
|
Join Date: Feb 2008
Posts: 2,543
Location: Bhavnagar, Gujarat, India
gaba88
Online
Forum Nokia Champion
|
|
|
Quote:
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 Gargi Das- http://gargidas.blogsot.com Forum Nokia Python Wiki Learn Python at http://mobapps.org/PyS60 |
|
Join Date: Oct 2007
Posts: 2,841
Location: Deva, Romania
Offline
Forum Nokia Champion
|
|
It's all in the first post
![]() |
|
Join Date: Feb 2008
Posts: 2,543
Location: Bhavnagar, Gujarat, India
gaba88
Online
Forum Nokia Champion
|
|
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. Gargi Das- http://gargidas.blogsot.com Forum Nokia Python Wiki Learn Python at http://mobapps.org/PyS60 |
|
Join Date: Oct 2007
Posts: 2,841
Location: Deva, Romania
Offline
Forum Nokia Champion
|
|
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?
|
|
Quote:
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/ |
|
Join Date: Oct 2007
Posts: 2,841
Location: Deva, Romania
Offline
Forum Nokia Champion
|
|
|
Quote:
And like I said in my previous post, the print statement won't display anything on a Canvas ![]() |
|
Try using appuifw.note instead of print in the callback.
import antigravity |
| ashwinurao |
| View Public Profile |
| Find all posts by ashwinurao |
|
Quote:
![]() 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()
![]() 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/ |
|
Join Date: Oct 2007
Posts: 2,841
Location: Deva, Romania
Offline
Forum Nokia Champion
|
|
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 09:52.
|
|
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 |
| ashwinurao |
| View Public Profile |
| Find all posts by ashwinurao |
|
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/ |
|
Join Date: Feb 2008
Posts: 2,543
Location: Bhavnagar, Gujarat, India
gaba88
Online
Forum Nokia Champion
|
|
|
Quote:
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 Gargi Das- http://gargidas.blogsot.com Forum Nokia Python Wiki Learn Python at http://mobapps.org/PyS60 |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Rate This Thread | |
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| CAknMessageQueryDialog not working on the Target E61 | symbians60 | Symbian User Interface | 4 | 2008-04-23 21:15 |
| No rule to male target | arayappan_it | Carbide.c++ IDE and plug-ins | 4 | 2008-02-28 11:49 |
| Working on GSM, Not working on CDMA | aminuddin09 | Mobile Java Networking & Messaging & Security | 0 | 2007-03-21 08:07 |
| Program suddenly not working - doesn't recognise hardware | luciadoll | Bluetooth Technology | 0 | 2006-12-10 02:54 |