You Are Here:

Community: Developer Discussion Boards

#1 Old Coming to the foreground when a system key is pressed - 2006-02-21, 10:24

Join Date: Jan 2006
Posts: 67
slitchfield
Offline
Regular Contributor
I've an idea for an application that would pop to the foreground briefly when a system key (in this case Menu/Apps) is pressed.

Can Python handle this? i.e. wait in the background for a specific keypress and then pop up? I had a look in the PDF docs but couldn't see anything suitable....

Steve Litchfield
Reply With Quote

#2 Old Re: Coming to the foreground when a system key is pressed - 2006-02-21, 14:00

Join Date: Feb 2006
Posts: 11
oscarsheepydog
Offline
Registered User
Hi Steve
I came across this, I have not tried it as yet though but it may be of some help
Cheers

appswitch - switch given application to foreground/background

With appswitch, you can control running applications in s60/python.

Following functionality is provided:
- listing applications
- switching them to foreground/background
- closing/killing

source & wins\udeb and armi\urel binaries included.
Switch application to foreground in pys60
http://pymbian.sourceforge.net/misc/...0.20051019.zip
Reply With Quote

#3 Old Re: Coming to the foreground when a system key is pressed - 2006-02-23, 07:42

Join Date: Feb 2005
Posts: 1,353
Location: Belgium (Europe)
cyke64's Avatar
cyke64
Offline
Super Contributor
hello ,

Even with appswitch it's not possible coming to the foreground an application by pressing menu key :-(
But you can manually switch from python application to menu by pressing menu key and programming after a delay an automatic return to python application (ie foreground )
PyS60 1.3.1 add a new feature appuifw.app.focus to allow this (look documentation)
Code:
import appuifw
import e32
from appswitch import *

def cb_focus(fg_st):
    if fg_st:
        appuifw.note(u'back to fg','info')
    else:    
        appuifw.note(u'Wait 3 secs in bg ...','info')
        timer.after(5)
        switch_to_fg(u'Python')
        print application_list(1)
        print appuifw.app.full_name()
        
def quit():        
    timer.cancel()
    appuifw.app.focus=old_cb
    lock.signal()
    appuifw.note(u'END','info')
        
lock=e32.Ao_lock()
timer=e32.Ao_timer()
old_cb=appuifw.app.focus
appuifw.app.focus=cb_focus
appuifw.app.exit_key_handler=quit
lock.wait()
attention ! If you launch this code from Python application (not standalone) if you let screensaver appearing(wait for a long time) it triggers Kernel Panic ...
I don't know why (a bug ?)
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
Can I measure the time period for which a key is pressed. aficianado_001 General Symbian C++ 2 2005-12-01 11:03
Bring an application from the background to the foreground on a key press. razas Symbian User Interface 7 2005-09-05 15:36
foreground without key events. Shaikuny General Symbian C++ 3 2004-10-29 17:29
how open/close the sound of system key zz_hzl Mobile Java Media (Graphics & Sounds) 0 2004-01-09 10:04
System wide hotkey with modifier problem kcome Symbian 0 2003-11-14 03:01

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 
RDF Facets: qdcZidentifierQSxhttpE3aE2fE2fdiscussionE2eforumE2enokiaE2ecomhttpE3aE2fE2fdiscussionE2eforumE2enokiaE2ecomE2fforumE2fshowthreadE2ephpE3ftE3d81449X qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfntypeZCommunityContentQ qdcZtypeQUqfntypeZE44iscussionQ qdcZtypeQUqfntypeZE44iscussionContentQ qdcZtypeQUqfntypeZE52esourceQ qdcZtypeQUqfntypeZWebpageQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qfnZtopicQUqfnTopicZpythonQ qfnZtypeQUqfntypeZCommunityContentQ qfnZtypeQUqfntypeZE44iscussionQ qfnZtypeQUqfntypeZE44iscussionContentQ qfnZtypeQUqfntypeZE52esourceQ qfnZtypeQUqfntypeZWebpageQ qfnZuserE5ftagQSxpythonX qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfntypeZCommunityContentQ qrdfZtypeQUqfntypeZE44iscussionQ qrdfZtypeQUqfntypeZE44iscussionContentQ qrdfZtypeQUqfntypeZE52esourceQ qrdfZtypeQUqfntypeZWebpageQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ