| Reply | « Previous Thread | Next Thread » |
|
Hi there,
I wonder if python is able to control an application running on the device. Maybe someone could script this for me: every 10 seconds the D-pad center button is 'pressed' by python in irRemote, so that every 10 seconds it sends an infrared signal. Is this possible? Maybe by emulating a keypress? Thanks, Jurrian |
|
Join Date: Oct 2007
Posts: 2,841
Location: Deva, Romania
Online
Forum Nokia Champion
|
|
Hi,
Yes, that should be possible using the keypress module to simulate keypresses. That thread contains the download links and a simple example. |
|
Sorry for being n00b, but I can't write python.
Could you write it for me? Just every 20 seconds a keypress for the center button in irRemote. Thanks in advance, Jurrian |
|
Join Date: Feb 2008
Posts: 2,542
Location: Bhavnagar, Gujarat, India
gaba88
Offline
Forum Nokia Champion
|
|
|
Quote:
if you cant write it is not at all difficult for you to write a one. Have a look at the following sites i am giving you and i believe that you can write a application in python after following those sites. Mobapps Forum Nokia python Wiki Enjoy Pythoning Gaba88 Gargi Das- http://gargidas.blogsot.com Forum Nokia Python Wiki Learn Python at http://mobapps.org/PyS60
Last edited by gaba88 : 2008-09-25 at 14:49.
|
|
Quote:
The link doesn't seem to work ! May be there is an extra 'p' ![]() |
|
Quote:
you can follow the signature link of Gaba88
Last edited by ck.umraliya : 2008-09-25 at 14:49.
Reason: missing
|
|
Join Date: Feb 2008
Posts: 2,542
Location: Bhavnagar, Gujarat, India
gaba88
Offline
Forum Nokia Champion
|
|
hi pankaj and chintan
thanks for letting me know that. There was a typo from myside i have edited the post.Now its working fine @jdvm Ya chintan is correct you can follow my signature also Enjoy Pythoning Gaba88 Gargi Das- http://gargidas.blogsot.com Forum Nokia Python Wiki Learn Python at http://mobapps.org/PyS60 |
|
Even after visiting the links you provided, I really do not thing I'm going to be able to write this. Maybe one of the python-pro's is able to write this for me? I would be very grateful.
Thanks, Jurrian |
|
Join Date: Feb 2008
Posts: 2,542
Location: Bhavnagar, Gujarat, India
gaba88
Offline
Forum Nokia Champion
|
|
|
Quote:
sorry that the links were not helpful. But if you are really not interested you can contact some developers personally. Hope this helps Gaba88 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
Online
Forum Nokia Champion
|
|
Well, here it is:
Code:
import keypress, appuifw, e32, appswitch from key_codes import * #Define the exit function app_lock=e32.Ao_lock() def quit(): global running running=0 app_lock.signal() appuifw.app.set_exit() appuifw.app.exit_key_handler=quit #Simulate pressing the "select" key every 10 seconds running=1 while running: e32.ao_sleep(10) if(appswitch.fg_appname()==u"irRemote"): keypress.simulate_key(EKeySelect, EScancodeSelect) app_lock.wait() *Your script shell has to be signed with the SwEvent capability to simulate keypresses. So download PythonScriptShell_1_4_2_3rdEd_unsigned_freedevcert.SIS from here and open sign it at www.symbiansigned.com with all capabilities. *You will also need appswitch for checking the name of the app that is currently in the foreground. Remember you have to sign appswitch and keypress at symbiansigned.com as they are unsigned. *You can also tweak this code to suit your needs. Like the interval between key presses. Make sure the name of the app is actually irRemote, otherwise it might not work. Oh, and here's another link that might help you learn Python if you're interested: www.croozeus.com |
|
Quote:
Its very simple, Code:
while True:
e32.ao_sleep(20) #wait for 20 seconds
keypress.simulate_key(EKeySelect, EKeySelect)#simulate select key
Best Regards, Croozeus |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Rate This Thread | |
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| Announcing a Python application for speed camera alerting | mposborne | Python | 6 | 2008-05-15 20:23 |
| BIO Message Parser Starting Application + Security Hole ? | Cr7pt0r | General Symbian C++ | 1 | 2008-05-08 13:32 |
| SIS file - Python 1.4.1 - Symbian S60 3rd Ed | Chiara81000 | Python | 3 | 2008-03-14 18:57 |
| Application Manager : SIS application not displayed | wap2tero | General Symbian C++ | 3 | 2005-09-16 04:37 |
| Application icon in Multiple sis file | umesh.roy | Symbian Tools & SDKs | 0 | 2005-03-16 10:39 |