You Are Here:

Community: Developer Discussion Boards

#1 Old binding EKeyLeftSoftkey not working - 2009-07-06, 14:12

Join Date: Feb 2006
Posts: 22
giaperrucci
Offline
Registered User
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!
Reply With Quote

#2 Old Re: binding EKeyLeftSoftkey not working - 2009-07-07, 05:33

Join Date: Feb 2008
Posts: 2,543
Location: Bhavnagar, Gujarat, India
Send a message via Yahoo to gaba88 Send a message via Skype™ to gaba88
gaba88's Avatar
gaba88
Online
Forum Nokia Champion
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


Gargi Das- http://gargidas.blogsot.com

Forum Nokia Python Wiki


Learn Python at http://mobapps.org/PyS60
Reply With Quote

#3 Old Re: binding EKeyLeftSoftkey not working - 2009-07-07, 10:10

Join Date: Feb 2006
Posts: 22
giaperrucci
Offline
Registered User
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.
Reply With Quote

#4 Old Re: binding EKeyLeftSoftkey not working - 2009-07-08, 03:45

Join Date: Feb 2008
Posts: 2,543
Location: Bhavnagar, Gujarat, India
Send a message via Yahoo to gaba88 Send a message via Skype™ to gaba88
gaba88's Avatar
gaba88
Online
Forum Nokia Champion
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


Gargi Das- http://gargidas.blogsot.com

Forum Nokia Python Wiki


Learn Python at http://mobapps.org/PyS60
Reply With Quote

#5 Old Re: binding EKeyLeftSoftkey not working - 2009-07-08, 07:11

Join Date: Oct 2007
Posts: 2,841
Location: Deva, Romania
bogdan.galiceanu's Avatar
bogdan.galiceanu
Offline
Forum Nokia Champion
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.
Reply With Quote

#6 Old Re: binding EKeyLeftSoftkey not working - 2009-07-08, 07:18

Join Date: Feb 2008
Posts: 2,543
Location: Bhavnagar, Gujarat, India
Send a message via Yahoo to gaba88 Send a message via Skype™ to gaba88
gaba88's Avatar
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
Reply With Quote

#7 Old Re: binding EKeyLeftSoftkey not working - 2009-07-08, 07:22

Join Date: Oct 2007
Posts: 2,841
Location: Deva, Romania
bogdan.galiceanu's Avatar
bogdan.galiceanu
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?
Reply With Quote

#8 Old Thumbs down Re: binding EKeyLeftSoftkey not working - 2009-07-08, 07:59

Join Date: Apr 2009
Posts: 65
nirpsis
Offline
Regular Contributor
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/
Reply With Quote

#9 Old Re: binding EKeyLeftSoftkey not working - 2009-07-08, 08:03

Join Date: Oct 2007
Posts: 2,841
Location: Deva, Romania
bogdan.galiceanu's Avatar
bogdan.galiceanu
Offline
Forum Nokia Champion
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
Reply With Quote

#10 Old Re: binding EKeyLeftSoftkey not working - 2009-07-08, 08:23

Join Date: Oct 2007
Posts: 114
ashwinurao
Offline
Regular Contributor
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
Reply With Quote

#11 Old Re: binding EKeyLeftSoftkey not working - 2009-07-09, 07:30

Join Date: Apr 2009
Posts: 65
nirpsis
Offline
Regular Contributor
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/
Reply With Quote

#12 Old Re: binding EKeyLeftSoftkey not working - 2009-07-09, 09:18

Join Date: Oct 2007
Posts: 2,841
Location: Deva, Romania
bogdan.galiceanu's Avatar
bogdan.galiceanu
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.
Reply With Quote

#13 Old Re: binding EKeyLeftSoftkey not working - 2009-07-09, 10:04

Join Date: Oct 2007
Posts: 114
ashwinurao
Offline
Regular Contributor
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
Reply With Quote

#14 Old Re: binding EKeyLeftSoftkey not working - 2009-07-09, 12:31

Join Date: Apr 2009
Posts: 65
nirpsis
Offline
Regular Contributor
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/
Reply With Quote

#15 Old Re: binding EKeyLeftSoftkey not working - 2009-07-09, 14:13

Join Date: Feb 2008
Posts: 2,543
Location: Bhavnagar, Gujarat, India
Send a message via Yahoo to gaba88 Send a message via Skype™ to gaba88
gaba88's Avatar
gaba88
Online
Forum Nokia Champion
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


Gargi Das- http://gargidas.blogsot.com

Forum Nokia Python Wiki


Learn Python at http://mobapps.org/PyS60
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
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

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