OESF | ELSI | pdaXrom | OpenZaurus | Zaurus Themes | Community Links | Ibiblio

IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Mapping A Keystroke To Qcop Commands, In Cacko1.23
Snappy
post Jan 31 2007, 06:11 AM
Post #1





Group: Members
Posts: 793
Joined: 28-November 04
From: NM, US, sometimes Asia
Member No.: 5,633



I've written a small script for toggling the input panel. (ime.sh)
It runs fine and now I'm trying to bind a keystroke to call it.

In keyhelper.conf, I added an additional line as follows

QUOTE
...
[Launch]
...
F26 = @qcop QPE/System 'execute(QString)' ime.sh
...


When I press Home+FirstJapKey (the one next to Ctrl), nothing happens. If I bind it as below, it calls up zeditor successfully.

QUOTE
...
[Launch]
...
F26 = Applications/zeditor
...


Anyone have any idea what is wrong with my call?
Go to the top of the page
 
+Quote Post
tml
post Jan 31 2007, 06:18 AM
Post #2





Group: Members
Posts: 105
Joined: 3-August 05
Member No.: 7,766



QUOTE(Snappy @ Jan 31 2007, 04:11 PM)
F26 = @qcop QPE/System 'execute(QString)' ime.sh


Make sure there is a tab after the @qcop (not a blank).
Go to the top of the page
 
+Quote Post
Snappy
post Jan 31 2007, 06:52 AM
Post #3





Group: Members
Posts: 793
Joined: 28-November 04
From: NM, US, sometimes Asia
Member No.: 5,633



QUOTE(tml @ Jan 31 2007, 10:18 PM)
QUOTE(Snappy @ Jan 31 2007, 04:11 PM)
F26 = @qcop QPE/System 'execute(QString)' ime.sh


Make sure there is a tab after the @qcop (not a blank).
*



Gee, thanks! That works brilliantly! Who would have guessed that!! biggrin.gif
Go to the top of the page
 
+Quote Post
Snappy
post Jan 31 2007, 08:26 AM
Post #4





Group: Members
Posts: 793
Joined: 28-November 04
From: NM, US, sometimes Asia
Member No.: 5,633



hmmm ... strangely, it seem to work, as in it blanks the screen but does not do anything.
Occassionally, home+key do not work altogether.

btw, my script ime.sh is as below
(I created a empty file at /home/tmp/ime_off)
CODE
#!/bin/sh
if [ -f /home/tmp/ime_on ]; then
    qcop    QPE/TaskBar 'hideInputMethod()'
    mv /home/tmp/ime_on /home/tmp/ime_off
else
    qcop    QPE/TaskBar 'showInputMethod()'
    mv /home/tmp/ime_off /home/tmp/ime_on
fi
Go to the top of the page
 
+Quote Post
tml
post Jan 31 2007, 11:37 AM
Post #5





Group: Members
Posts: 105
Joined: 3-August 05
Member No.: 7,766



QUOTE(Snappy @ Jan 31 2007, 06:26 PM)
hmmm ... strangely, it seem to work, as in it blanks the screen but does not do anything.
[/code]
*


It probably tries to change resolution or so. The execute command tries to start a qpe qpe application which a sh script is not, I think. I'd say you'd have to wrap the script into something qtopian but maybe there's a simpler solution.
Go to the top of the page
 
+Quote Post
Snappy
post Jan 31 2007, 11:48 AM
Post #6





Group: Members
Posts: 793
Joined: 28-November 04
From: NM, US, sometimes Asia
Member No.: 5,633



QUOTE(tml @ Feb 1 2007, 03:37 AM)
QUOTE(Snappy @ Jan 31 2007, 06:26 PM)
hmmm ... strangely, it seem to work, as in it blanks the screen but does not do anything.
[/code]
*


It probably tries to change resolution or so. The execute command tries to start a qpe qpe application which a sh script is not, I think. I'd say you'd have to wrap the script into something qtopian but maybe there's a simpler solution.
*



I see ... hmmm ... is there maybe a way for keyhelper app to run a .sh script directly?
Go to the top of the page
 
+Quote Post
Meanie
post Jan 31 2007, 07:49 PM
Post #7





Group: Members
Posts: 2,808
Joined: 21-March 05
From: Sydney, Australia
Member No.: 6,686



QUOTE(Snappy @ Feb 1 2007, 02:26 AM)
hmmm ... strangely, it seem to work, as in it blanks the screen but does not do anything.
Occassionally, home+key do not work altogether.

btw, my script ime.sh is as below
(I created a empty file at /home/tmp/ime_off)
CODE
#!/bin/sh
if [ -f /home/tmp/ime_on ]; then
    qcop    QPE/TaskBar 'hideInputMethod()'
    mv /home/tmp/ime_on /home/tmp/ime_off
else
    qcop    QPE/TaskBar 'showInputMethod()'
    mv /home/tmp/ime_off /home/tmp/ime_on
fi

*


your qcop commands need to run as the zaurus user. maybe your script is called as root user.
try something like

su zaurus -c "qcop QPE/TaskBar 'hideInputMethod()'"
Go to the top of the page
 
+Quote Post
Snappy
post Jan 31 2007, 08:35 PM
Post #8





Group: Members
Posts: 793
Joined: 28-November 04
From: NM, US, sometimes Asia
Member No.: 5,633



QUOTE(Meanie @ Feb 1 2007, 11:49 AM)
your qcop commands need to run as the zaurus user. maybe your script is called as root user.
try something like

su zaurus -c  "qcop QPE/TaskBar 'hideInputMethod()'"
*


ok, modified as per above, still shows a black blank screen and returns after awhile without toggling input panel.

Further, running the script from konsole causing the script to ask for password.
Go to the top of the page
 
+Quote Post
bam
post Jan 31 2007, 08:38 PM
Post #9





Group: Members
Posts: 1,213
Joined: 9-June 05
From: Gobi Desert, Mongolia
Member No.: 7,306



try creating an icon that calls the script then call the icon of the script via qcop channel
Go to the top of the page
 
+Quote Post
Snappy
post Jan 31 2007, 09:15 PM
Post #10





Group: Members
Posts: 793
Joined: 28-November 04
From: NM, US, sometimes Asia
Member No.: 5,633



QUOTE(bam @ Feb 1 2007, 12:38 PM)
try creating an icon that calls the script then call the icon of the script via qcop channel
*


hmmm ... sounds like a plan! smile.gif
Go to the top of the page
 
+Quote Post
Snappy
post Jan 31 2007, 09:30 PM
Post #11





Group: Members
Posts: 793
Joined: 28-November 04
From: NM, US, sometimes Asia
Member No.: 5,633



ok, so far seems to work ... smile.gif ... but takes like 3 seconds to do it! ohmy.gif

Thanks all for the input and suggestions! biggrin.gif
Once I get to my notebook, I'll write a C app to do it properly. My only hurdle is compiling for Z ... something I haven't come up to speed.

btw, meanie, can I gcc natively using gcc from pdaXqtrom?
Go to the top of the page
 
+Quote Post
Meanie
post Jan 31 2007, 09:34 PM
Post #12





Group: Members
Posts: 2,808
Joined: 21-March 05
From: Sydney, Australia
Member No.: 6,686



QUOTE(Snappy @ Feb 1 2007, 03:30 PM)
ok, so far seems to work ... smile.gif ... but takes like 3 seconds to do it! ohmy.gif

Thanks all for the input and suggestions! biggrin.gif
Once I get to my notebook, I'll write a C app to do it properly. My only hurdle is compiling for Z ... something I haven't come up to speed.

btw, meanie, can I gcc natively using gcc from pdaXqtrom?
*


of course you can. my zgcc image supports both qte and xqt
Go to the top of the page
 
+Quote Post
Snappy
post Feb 1 2007, 03:10 PM
Post #13





Group: Members
Posts: 793
Joined: 28-November 04
From: NM, US, sometimes Asia
Member No.: 5,633



QUOTE(Meanie @ Feb 1 2007, 01:34 PM)
QUOTE(Snappy @ Feb 1 2007, 03:30 PM)
ok, so far seems to work ... smile.gif ... but takes like 3 seconds to do it! ohmy.gif

Thanks all for the input and suggestions! biggrin.gif
Once I get to my notebook, I'll write a C app to do it properly. My only hurdle is compiling for Z ... something I haven't come up to speed.

btw, meanie, can I gcc natively using gcc from pdaXqtrom?
*


of course you can. my zgcc image supports both qte and xqt
*



Roger that, thanks! smile.gif
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 25th October 2014 - 01:16 PM