Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Kobo Reader > Kobo Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 02-12-2015, 05:20 PM   #1
boriar
Evangelist
boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.
 
boriar's Avatar
 
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.
boriar is offline   Reply With Quote
Old 02-12-2015, 05:56 PM   #2
tshering
Wizard
tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.
 
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
tshering is offline   Reply With Quote
Advert
Old 02-12-2015, 06:35 PM   #3
boriar
Evangelist
boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.
 
boriar's Avatar
 
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.
boriar is offline   Reply With Quote
Old 02-13-2015, 03:33 AM   #4
tshering
Wizard
tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.
 
Posts: 3,489
Karma: 2914715
Join Date: Jun 2012
Device: kobo touch
Quote:
Originally Posted by boriar View Post
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.
That is exactly what I have suggested. "define exactly two touch zones" implies: You cannot define one, three, four, ...
tshering is offline   Reply With Quote
Old 02-13-2015, 05:31 AM   #5
frostschutz
Linux User
frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.
 
frostschutz's Avatar
 
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
frostschutz is offline   Reply With Quote
Advert
Old 02-13-2015, 10:09 AM   #6
boriar
Evangelist
boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.
 
boriar's Avatar
 
Posts: 407
Karma: 314204
Join Date: Jan 2015
Device: bq Avant XL, Kobo Aura H2O, Onyx Boox M96C Plus
Quote:
Originally Posted by tshering View Post
That is exactly what I have suggested. "define exactly two touch zones" implies: You cannot define one, three, four, ...
Sorry, i misunderstood you

Quote:
Originally Posted by frostschutz View Post
it prints the touched (X,Y) though, so you could define an unreachable touch zone and then parse the output yourself
Where are they stored?
Which variables?
boriar is offline   Reply With Quote
Old 02-15-2015, 11:20 AM   #7
boriar
Evangelist
boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.
 
boriar's Avatar
 
Posts: 407
Karma: 314204
Join Date: Jan 2015
Device: bq Avant XL, Kobo Aura H2O, Onyx Boox M96C Plus
Quote:
Originally Posted by boriar View Post
Where are they stored?
Which variables?
Nobody knows how can i get X and Y?
boriar is offline   Reply With Quote
Old 02-15-2015, 01:06 PM   #8
tshering
Wizard
tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.
 
Posts: 3,489
Karma: 2914715
Join Date: Jun 2012
Device: kobo touch
Quote:
Originally Posted by boriar View Post
Nobody knows how can i get X and Y?
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)
(903, 394) are the values you are interested in.
tshering is offline   Reply With Quote
Old 02-15-2015, 01:25 PM   #9
boriar
Evangelist
boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.
 
boriar's Avatar
 
Posts: 407
Karma: 314204
Join Date: Jan 2015
Device: bq Avant XL, Kobo Aura H2O, Onyx Boox M96C Plus
Quote:
Originally Posted by tshering View Post
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)
(903, 394) are the values you are interested in.
Ah! I see. Thanks.
boriar is offline   Reply With Quote
Old 02-15-2015, 07:11 PM   #10
frostschutz
Linux User
frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.
 
frostschutz's Avatar
 
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...
frostschutz is offline   Reply With Quote
Old 10-08-2015, 01:29 PM   #11
spelufo
Member
spelufo began at the beginning.
 
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
Does it consume a lot of resources to have pickel wait-for-hit running a lot?
spelufo is offline   Reply With Quote
Old 10-08-2015, 03:16 PM   #12
frostschutz
Linux User
frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.
 
frostschutz's Avatar
 
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...
frostschutz is offline   Reply With Quote
Old 10-09-2015, 08:06 AM   #13
spelufo
Member
spelufo began at the beginning.
 
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 $@
spelufo is offline   Reply With Quote
Old 10-09-2015, 09:18 AM   #14
spelufo
Member
spelufo began at the beginning.
 
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.
spelufo is offline   Reply With Quote
Old 10-09-2015, 09:21 AM   #15
frostschutz
Linux User
frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.
 
frostschutz's Avatar
 
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.
frostschutz is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
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


All times are GMT -4. The time now is 05:07 PM.


MobileRead.com is a privately owned, operated and funded community.