![]() |
#1 |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 407
Karma: 314204
Join Date: Jan 2015
Device: bq Avant XL, Kobo Aura H2O, Onyx Boox M96C Plus
|
pickel dude
Is it posible to define more that two touch zones with "pickel wait-for-hit"?
Whenever i try to define three or more pickel don't-wait-for-hit. I can fine any documentation or orientation for it. ![]() |
![]() |
![]() |
![]() |
#2 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,489
Karma: 2914715
Join Date: Jun 2012
Device: kobo touch
|
From the description it seems you have to define exactly two touch zones.
Code:
Syntax: wait-for-hit x1 y1 width1 height1 x2 y2 width2 height2 return value: 1 for button 1, 2 for button 2 |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 407
Karma: 314204
Join Date: Jan 2015
Device: bq Avant XL, Kobo Aura H2O, Onyx Boox M96C Plus
|
No, actually I have two zones but i need to define more an seems that use:
wait-for-hit x1 y1 width1 height1 x2 y2 width2 height2 x3 y3 width3 height3 don't work at all. |
![]() |
![]() |
![]() |
#4 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,489
Karma: 2914715
Join Date: Jun 2012
Device: kobo touch
|
That is exactly what I have suggested. "define exactly two touch zones" implies: You cannot define one, three, four, ...
|
![]() |
![]() |
![]() |
#5 |
Linux User
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,282
Karma: 6123806
Join Date: Sep 2010
Location: Heidelberg, Germany
Device: none
|
it prints the touched (X,Y) though, so you could define an unreachable touch zone and then parse the output yourself
|
![]() |
![]() |
Advert | |
|
![]() |
#6 | ||
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 407
Karma: 314204
Join Date: Jan 2015
Device: bq Avant XL, Kobo Aura H2O, Onyx Boox M96C Plus
|
Quote:
Quote:
Which variables? |
||
![]() |
![]() |
![]() |
#7 |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 407
Karma: 314204
Join Date: Jan 2015
Device: bq Avant XL, Kobo Aura H2O, Onyx Boox M96C Plus
|
|
![]() |
![]() |
![]() |
#8 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,489
Karma: 2914715
Join Date: Jun 2012
Device: kobo touch
|
It is as Frostschutz said.
Code:
[root@(none) ~]# result=$(/usr/local/Kobo/pickel wait-for-hit 0 0 0 0 0 0 0 0) [root@(none) ~]# echo $result Screen: (1024, 758) (0, 758) w: 0, h: 0 (0, 758) w: 0, h: 0 (903, 394) |
![]() |
![]() |
![]() |
#9 |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 407
Karma: 314204
Join Date: Jan 2015
Device: bq Avant XL, Kobo Aura H2O, Onyx Boox M96C Plus
|
Ah! I see. Thanks.
|
![]() |
![]() |
![]() |
#10 |
Linux User
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,282
Karma: 6123806
Join Date: Sep 2010
Location: Heidelberg, Germany
Device: none
|
You should read the output continuously... pickel | while read line do parse coordinates
I haven't actually tried this myself, but it should work... |
![]() |
![]() |
![]() |
#11 |
Member
![]() Posts: 10
Karma: 10
Join Date: Oct 2013
Device: Kobo H2O
|
Sort of related... I've made this script to listen for a certain sequence of taps and execute stuff when they happen. The dimentions are for the H2O. It needs to be run in the background.
Code:
#!/bin/sh # +------+------+------+------+ # | | | | (x,y)| # | (3,0)| (2,0)| (1,0)| (0,0)| # | | | | | # +------+------+------+------+ # | | | | | # | (3,1)| (2,1)| (1,1)| (0,1)| # | | | | | # +------+------+------+------+ # | | | | | # | (3,2)| (2,2)| (1,2)| (0,2)| # | | | | | # +------+------+------+------+ # | | | | | # | (3,3)| (2,3)| (1,3)| (0,3)| # | | | | | # +------+------+------+------+ # | | | | | # | (3,4)| (2,4)| (1,4)| (0,4)| # | | | | | # +------+------+------+------+ quadhit() { /usr/local/Kobo/pickel wait-for-hit $(( $1 * 1080 / 4)) $(( $2 * 1440 / 5 )) 270 288 0 0 0 0 &>/dev/null } listen=true while $listen; do quadhit 0 4 [ $? -eq 1 ] || continue start="$(date +'%s')" quadhit 1 4 [ $? -eq 1 ] || continue [ $(( $(date +'%s') - $start )) -lt 3 ] || continue quadhit 2 4 [ $? -eq 1 ] || continue [ $(( $(date +'%s') - $start )) -lt 3 ] || continue quadhit 3 4 [ $? -eq 1 ] || continue [ $(( $(date +'%s') - $start )) -lt 3 ] || continue listen=false done exec /mnt/onboard/.kobo/koreader/koreader.sh |
![]() |
![]() |
![]() |
#12 |
Linux User
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,282
Karma: 6123806
Join Date: Sep 2010
Location: Heidelberg, Germany
Device: none
|
You could grab the screen dimensions [1080 1440] from 'fbset' then it might work for all readers. It's a nice idea and I would assume that it does not take many resources in regular usage. Might be different when you use the sketch pad and use the screen a lot...
|
![]() |
![]() |
![]() |
#13 |
Member
![]() Posts: 10
Karma: 10
Join Date: Oct 2013
Device: Kobo H2O
|
OK, it turns out the previous script was totally wrong. Pickels coordinates are weird. The arguments tp pickel are from the top-left corner on the screen. The output is (Y,X) with coordinates from the top-right corner of the screen. Also, if you pass 0 0 0 0 as one of the rectangles it will take that rectangle as the whole screen, which is why I use 0 0 1 1 for the rectangle I don't care about.
Code:
#!/bin/sh [ $# -gt 0 ] || { echo 'Usage: tap-actiond.sh COMMAND' echo ' Wait for a sequence of taps on the touch screen and exec COMMAND when they occur.' exit 0 } FB_MODE="$(fbset | grep '^mode' | cut -d \" -f 2)" FB_MODE="${FB_MODE%-*}" FB_W="${FB_MODE%x*}" FB_H="${FB_MODE#*x}" w=$(( $FB_W / 4)) h=$(( $FB_H / 5)) waithit() { coords="$(( $1 * $w )) $(( $2 * $h )) $w $h" /usr/local/Kobo/pickel wait-for-hit $coords 0 0 1 1 &>/dev/null } listen=true while $listen; do waithit 3 4 [ $? -eq 1 ] || continue start=$(date +'%s') waithit 2 4 [ $? -eq 1 ] || continue [ $(( $(date +'%s') - $start )) -lt 3 ] || continue waithit 1 4 [ $? -eq 1 ] || continue [ $(( $(date +'%s') - $start )) -lt 3 ] || continue waithit 0 4 [ $? -eq 1 ] || continue [ $(( $(date +'%s') - $start )) -lt 3 ] || continue listen=false done exec $@ |
![]() |
![]() |
![]() |
#14 |
Member
![]() Posts: 10
Karma: 10
Join Date: Oct 2013
Device: Kobo H2O
|
It works from the shell via telnet, but not when I run it on boot. I don't know what is going on.
|
![]() |
![]() |
![]() |
#15 |
Linux User
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,282
Karma: 6123806
Join Date: Sep 2010
Location: Heidelberg, Germany
Device: none
|
How do you run it on boot? udev kills scripts that take too long, you have to setsid...
Also I'm not sure about wait for touch, but pickel showpic required additional environment variables in some firmware versions. You can steal them from nickel's environment. |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
BRING BACK THE KOBO DUDE AND QUOTES | jackastor | Kobo Reader | 8 | 11-06-2013 10:08 AM |
Another Old Dude | Dontee | Introduce Yourself | 6 | 12-30-2011 01:51 PM |
New EE dude | HHH | Introduce Yourself | 3 | 07-16-2011 05:07 AM |
Dude!! This is what it's about! | kennyc | News | 48 | 09-19-2009 08:57 AM |