Author Topic: How launch an applet with a Key ?  (Read 2797 times)

totoetlititi

  • Newbie
  • *
  • Posts: 39
    • View Profile
    • http://
How launch an applet with a Key ?
« on: May 10, 2004, 10:13:40 am »
I\'m searching a way to turn off the screen (the applet \"LCD switch\") when I push the button \"menu\"...
In \"settings\" \"Application key\", I can only launch application with the key, no applet...
It is possible ?

tumnus

  • Hero Member
  • *****
  • Posts: 1176
    • View Profile
    • http://www.cpinkney.org.uk
How launch an applet with a Key ?
« Reply #1 on: May 10, 2004, 10:47:05 am »
The easier way to do this is probably to create an icon that runs a script containing the following:
Code: [Select]
#!/bin/sh

qcop QPE/System \'setBlankLCD(int)\' 1

This script does the same thing as the LCD applet. Then you can define this to be run by pressing the Menu button.
# Search the Zaurus Howtos ## Search the Zaurus FAQs ## Find Z software at ELSI #
--------------------
UK SL5500 with Sharp ROM 3.13, SL5600 with Sharp ROM 1.32 - SuSE 9.0 Pro, Windows XP Home
Qualendar for Calendar and Todo
Socket Bluetooth CF Card (Rev F), Kingmax 512MB MMC Card, Palm Tungsten T Stylus,
Pretec CF->Smartmedia Adapter, Semsons Universal Battery Extender

totoetlititi

  • Newbie
  • *
  • Posts: 39
    • View Profile
    • http://
How launch an applet with a Key ?
« Reply #2 on: May 10, 2004, 10:47:55 am »
Thanks !
But there is no way to use directly my applet ?

fpp

  • Full Member
  • ***
  • Posts: 187
    • View Profile
    • http://
How launch an applet with a Key ?
« Reply #3 on: May 10, 2004, 10:48:20 am »
If you are using Cacko ROM 1.21 (at least), you can do something like that with Keyhelper.

PS: c\'est tout expliqué sur le forum PDAFrance ;-)

totoetlititi

  • Newbie
  • *
  • Posts: 39
    • View Profile
    • http://
How launch an applet with a Key ?
« Reply #4 on: May 10, 2004, 11:01:41 am »
lol!
mon anglais est si terrible ???...!!!!
but I have a sl5500 with the sharp rom 3.13... no cacko rom !
And I can\'t use \"qcop ...\" in a script...
What is the end of the script ?$
\"&\", \";\",\"exit\"... ?

DrWowe

  • Hero Member
  • *****
  • Posts: 696
    • View Profile
    • http://
How launch an applet with a Key ?
« Reply #5 on: May 10, 2004, 11:25:55 am »
Quote
Thanks !
But there is no way to use directly my applet ?


Create a desktop icon to call your script.  Then you can assign it to a key.

BTW, is there a list out there somewhere of everything that you can do with qcop?  I would like to see what else can be done, hopefully things like changing screen brightness, rotating the screen, changing dimming timeouts, and I can probably think of many more.

tumnus

  • Hero Member
  • *****
  • Posts: 1176
    • View Profile
    • http://www.cpinkney.org.uk
How launch an applet with a Key ?
« Reply #6 on: May 10, 2004, 12:21:28 pm »
Keyhelper will work with the SL5500 Sharp 3.x ROMs but that is not needed for something as simple as this. Like DrWowe said, create the script as a text file as above an put it in /home/QtPalmtop/bin ensuring it is in Unix text format. Make it executable and then create a desktop icon with the Tab Setting app and set the Exec field to the script file name (not the full path). You can then use this on the Menu button using the Application Keys app.

As for the QCOP messages, the standard Trolltech ones are listed here:
http://doc.trolltech.com/qtopia1.6/html/qcop.html

However Sharp\'s Qtopia has a few extra undocumented ones, like setBlankLCD. Also you have to look at the Qtopia source code to figure out what you\'re supposed pass to things like setScreenSaverInterval which somewhat unintuitively controls the screen dimming and autosuspend. I\'m not sure if the Trolltech setDefaultRotation is the same as the one in Sharp\'s Qtopia since Sharp implemented rotation before Trolltech I think, or at least independently. Without the source code, the best you can do is grep libqpe for qcop strings.
# Search the Zaurus Howtos ## Search the Zaurus FAQs ## Find Z software at ELSI #
--------------------
UK SL5500 with Sharp ROM 3.13, SL5600 with Sharp ROM 1.32 - SuSE 9.0 Pro, Windows XP Home
Qualendar for Calendar and Todo
Socket Bluetooth CF Card (Rev F), Kingmax 512MB MMC Card, Palm Tungsten T Stylus,
Pretec CF->Smartmedia Adapter, Semsons Universal Battery Extender

totoetlititi

  • Newbie
  • *
  • Posts: 39
    • View Profile
    • http://
How launch an applet with a Key ?
« Reply #7 on: May 11, 2004, 03:31:02 am »
I made a script, an icon an file.desktop, and.... it works !
(I just made an error: \"SetBlankLCD(int)\" instead of \"setBlankLCD(int)\"...  !!!)