Add ekey hook

parent cc7a4553
Pipeline #1255 passed with stage
in 11 minutes and 7 seconds
......@@ -583,6 +583,7 @@ Defer >poll-events ( delay -- )
[THEN] ;
Defer looper-hook ( -- ) ' noop is looper-hook
Defer looper-ekey ( -- ) ' noop is looper-ekey
: #looper ( delay -- ) #1000000 *
event-handler @ .?looper-timeouts >poll-events
......@@ -591,6 +592,7 @@ Defer looper-hook ( -- ) ' noop is looper-hook
xpollfds $@ pollfd / xpoll
IF
xpollfds $@ drop revents w@ POLLIN and IF ?events THEN
xpollfds $@ drop pollfd + revents w@ POLLIN and IF looper-ekey THEN
dpy IF
dpy XPending xpollfds $@ drop
[ pollfd 2* ]L + revents w@ POLLIN and or IF get-events THEN
......
......@@ -93,6 +93,16 @@ DOES> ( x-key [addr] -- ekey )
ELSE look_key l@ x-key>ekey# ?dup-IF
top-act ?dup-IF .ekeyed ELSE #esc = level# +! THEN THEN THEN
; x11-handler to DoKeyPress
here
' (key) A,
' (key?) A,
A, here AConstant default-in'
:noname
default-in' ip-vector !@ >r ekey r> ip-vector !
ekey>xchar IF [: xemit ;] $tmp top-act .ukeyed EXIT THEN
top-act .ekeyed
; is looper-ekey
\ ' noop x11-handler to DoKeyRelease
: samepos? ( x y -- flag )
lastpos 2@ rot - dup * -rot - dup * + samepos < ;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment