Index: gl-slideshow.fs ================================================================== --- gl-slideshow.fs +++ gl-slideshow.fs @@ -217,44 +217,48 @@ THEN rdrop ; : (reshow) ( -- ) 0e >y-pos - 1 level# +! BEGIN prefetch slide-input level# @ 0= UNTIL ; + BEGIN prefetch slide-input level# @ 0= UNTIL ; : reshow ( -- ) [IFDEF] android kbflag @ IF togglekb THEN [THEN] - slideshow-init (reshow) ; + 1 level# +! slideshow-init (reshow) ; -: thumb-input ( -- ) +: up-down ( -- ) ekey? IF ekey case k-up of [ thumb# dup * negate ]L thumb-slide endof k-down of [ thumb# dup * ]L thumb-slide endof + #esc of -1 level# +! endof endcase - THEN - >looper ?esc + THEN ; + +: thumb-input ( -- ) up-down + >looper *input >r r@ IF - case r@ action @ r@ action on - 1 ( AMOTION_EVENT_ACTION_UP ) of + r@ action @ + case 1 of short? IF thumb# dup click-regions thumb# * + current-slide +! - -1 level# +! (reshow) 1 level# +! + (reshow) 1 level# +! 0 thumb-slide THEN + r@ action on endof - 0 of !click r@ y0 @ last-y0 ! endof - 2 of + abs 1 <> IF thumb# r@ y0 @ last-y0 motion-y0 ['] +thumb-slide do-motion - endof - last-y0 motion-y0 ['] +thumb-slide drag-motion + ELSE + last-y0 motion-y0 ['] +thumb-slide drag-motion + THEN 0 endcase THEN rdrop ; : rethumb ( -- ) [IFDEF] android kbflag @ IF togglekb THEN [THEN] 0e >y-pos - slideshow-init 0 thumb-slide - 1 level# +! BEGIN prefetch-thumb thumb-input level# @ 0= UNTIL ; + 1 level# +! slideshow-init 0 thumb-slide + BEGIN prefetch-thumb thumb-input level# @ 0= UNTIL ; : slide-show ( addr u -- ) slidelist $[]slurp-file current-slide off reshow ; : thumb-show ( addr u -- ) slidelist $[]slurp-file current-slide off rethumb ; Index: gl-terminal.fs ================================================================== --- gl-terminal.fs +++ gl-terminal.fs @@ -252,11 +252,11 @@ gl-xy @ scroll-y @ dup r@ + within 0= IF gl-xy @ 1+ r@ - 0 max s>f set-scroll THEN rdrop need-show off ; [IFUNDEF] win : win app window @ ; [THEN] -: screen-sync ( -- ) need-sync @ win and IF +: screen-sync ( -- ) need-sync @ win and level# @ 0<= and IF show-cursor screen->gl need-sync off THEN ; : config-changer ( -- ) getwh >screen-orientation need-sync on ; @@ -293,13 +293,12 @@ ELSE last-y0 motion-y0 ['] +scroll drag-motion THEN 0 endcase THEN rdrop ; -:noname ( flag -- flag ) screen-sync -\ [: touch>event screen-slide ;] is android-touch - screen-slide scroll-slide ; IS screen-ops +:noname ( flag -- flag ) level# @ 0> ?EXIT + screen-sync screen-slide scroll-slide ; IS screen-ops ' gl-type ' gl-emit ' gl-cr ' gl-form output: >screen >screen ' gl-atxy IS at-xy Index: gles2/android.fs ================================================================== --- gles2/android.fs +++ gles2/android.fs @@ -191,11 +191,12 @@ \ : >looper BEGIN 0 poll_looper 0< UNTIL looper-to# poll_looper drop ; \ : ?looper BEGIN >looper app window @ UNTIL ; :noname 0 poll? drop defers key? ; IS key? Defer screen-ops ' noop IS screen-ops -:noname need-show on BEGIN >looper key? screen-ops UNTIL +:noname + need-show on BEGIN >looper key? screen-ops UNTIL defers key dup #cr = key? and IF key ?dup-IF unkey THEN THEN ; IS key : enum dup Constant 1+ ; 0 Index: gles2/gl-terminal.fs ================================================================== --- gles2/gl-terminal.fs +++ gles2/gl-terminal.fs @@ -252,11 +252,11 @@ gl-xy @ scroll-y @ dup r@ + within 0= IF gl-xy @ 1+ r@ - 0 max s>f set-scroll THEN rdrop need-show off ; [IFUNDEF] win : win app window @ ; [THEN] -: screen-sync ( -- ) need-sync @ win and IF +: screen-sync ( -- ) need-sync @ win and level# @ 0<= and IF show-cursor screen->gl need-sync off THEN ; : config-changer ( -- ) getwh >screen-orientation need-sync on ; @@ -293,13 +293,12 @@ ELSE last-y0 motion-y0 ['] +scroll drag-motion THEN 0 endcase THEN rdrop ; -:noname ( flag -- flag ) screen-sync -\ [: touch>event screen-slide ;] is android-touch - screen-slide scroll-slide ; IS screen-ops +:noname ( flag -- flag ) level# @ 0> ?EXIT + screen-sync screen-slide scroll-slide ; IS screen-ops ' gl-type ' gl-emit ' gl-cr ' gl-form output: >screen >screen ' gl-atxy IS at-xy