You Are Here:

Community: Developer Discussion Boards

#1 Old Enabling and Disabling right soft key - 2009-03-08, 08:00

Join Date: Jan 2009
Posts: 33
soontobeared
Offline
Registered User
Hi,
How can I enable/disable right soft key ?

Btw,I am working with S60 3edition FP1 and using N95 8GB

Thanks&Regards
Reply With Quote

#2 Old Re: Enabling and Disabling right soft key - 2009-03-08, 08:41

Join Date: Feb 2008
Posts: 2,542
Location: Bhavnagar, Gujarat, India
Send a message via Yahoo to gaba88 Send a message via Skype™ to gaba88
gaba88's Avatar
gaba88
Offline
Forum Nokia Champion
Quote:
Originally Posted by soontobeared View Post
Hi,
How can I enable/disable right soft key ?

Btw,I am working with S60 3edition FP1 and using N95 8GB

Thanks&Regards
hello soontobeared

what do you exactly mean by enabling or disabling the right soft key??

Regards
Gaba88


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

Forum Nokia Python Wiki


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

#3 Old Re: Enabling and Disabling right soft key - 2009-03-08, 09:08

Join Date: Jan 2009
Posts: 33
soontobeared
Offline
Registered User
Hi gaba,
In my application, clicking the right soft key('Exit') gives a popup menu which has a 'Hide' option.Clicking the 'Hide' hides my application and lets it run in the background. Initially i don't want to provide this hiding capability to the user and would like to make it available at a later point of time.

So I am thinking about locking the right soft key initially so that the user can't access the 'Hide' option and unlock it when I like to.

How can I achieve this?

Btw, by locking/disabling, I mean that nothing should happen on clicking the button(no event to be triggered).

Thanks&Regards.
Last edited by soontobeared : 2009-03-08 at 09:17. Reason: Added Something
Reply With Quote

#4 Old Re: Enabling and Disabling right soft key - 2009-03-08, 09:19

Join Date: Oct 2007
Posts: 2,841
Location: Deva, Romania
bogdan.galiceanu's Avatar
bogdan.galiceanu
Offline
Forum Nokia Champion
Hi,

One way to do it is to detect when the right softkey is pressed and do nothing using the keycapture module. Then when you need the softkey again, just stop the capturer. See the keycapture section in the PyS60 Library Reference.
Code:
import keycapture
from key_codes import *


def cb_capture(key):
	if key == EKeyRightSoftkey:
		pass

capturer = keycapture.KeyCapturer(cb_capture)
capturer.keys = (EKeyRightSoftkey)
capturer.start()
Reply With Quote

#5 Old Re: Enabling and Disabling right soft key - 2009-03-08, 13:30

Join Date: Oct 2008
Posts: 54
Anime
Offline
Regular Contributor
Quote:
Code:
import keycapture
from key_codes import *


def cb_capture(key):
	if key == EKeyRightSoftkey:
		pass

capturer = keycapture.KeyCapturer(cb_capture)
capturer.keys = (EKeyRightSoftkey)
capturer.start()
TypeError: iteration over non-sequence
Reply With Quote

#6 Old Re: Enabling and Disabling right soft key - 2009-03-08, 13:33

Join Date: Oct 2008
Posts: 54
Anime
Offline
Regular Contributor
Code:
import keycapture
from key_codes import *


def cb_capture(key):
	if key == EKeyRightSoftkey:
		pass

capturer = keycapture.KeyCapturer(cb_capture)
capturer.keys = (EKeyRightSoftkey,)
capturer.start()
Reply With Quote

#7 Old Re: Enabling and Disabling right soft key - 2009-03-09, 03:04

Join Date: Jan 2009
Posts: 33
soontobeared
Offline
Registered User
Hi Anime and Bogdan,
THanks for the reply.

Please help me debug this code.
Code:
def __init__(self):
        capturer = keycapture.KeyCapturer(self.cb_capture)
        capturer.keys = (EKeyRightSoftkey,)
        capturer.start()

def cb_capture(self,key):
	if key == EKeyRightSoftkey:
		pass
The above code snippet doesn't work.Is my callback method defined the right way?
Btw, I am a python noob

Thanks&Regards
Last edited by soontobeared : 2009-03-09 at 08:43.
Reply With Quote

#8 Old Re: Enabling and Disabling right soft key - 2009-03-10, 05:32

Join Date: Jan 2009
Posts: 33
soontobeared
Offline
Registered User
Hi,
I fixed it.

Thanks
Reply With Quote

#9 Old Re: Enabling and Disabling right soft key - 2009-03-11, 08:39

Join Date: Nov 2007
Posts: 17
psychologe
Offline
Registered User
capture.keys is a list.can read and write .
use capture.keys.append(EKeyRightSoft) instead capture.keys=(EKeyRightSoft)
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
Problem with Skin enabling - disabling and Setting List in S60 sauvikds Series 40 & S60 Platform Feedback 6 2008-08-23 15:29
Problem with Skin enabling - disabling and Setting List in S60 sauvikds Symbian User Interface 1 2008-08-22 14:45
Problem with Skin enabling - disabling and Setting List in S60 sauvikds General Discussion 1 2008-08-21 13:44

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