commit b346323d0b141ab4e83b4a7e0f5ba49442a70466 parent 7ea1e9a0e7923dc9ffbac1863da63f221e2fce95 Author: Daniel Barlow <dan@telent.net> Date: Sun, 8 May 2022 22:48:44 +0100 detect mouse clicks in bottom bar (hacky) Diffstat:
| M | rc.fnl | | | 25 | +++++++++++++++++++++++++ |
1 file changed, 25 insertions(+), 0 deletions(-)
diff --git a/rc.fnl b/rc.fnl @@ -47,6 +47,31 @@ (- 360 30 bar-height) (- 720 bar-height) 0.7))))))) +(fn kill-window [] + (print "DIE") + true) + +(fn launch [] + (print "WHOOSH") + true) + +(fn carousel [] + (print "spin spin sugar") + true) + +(let [cursor (kiwmi:cursor)] + (cursor:on "button_down" + (fn [button] + (let [(x y) (cursor:pos)] + (if (> y 680) + (if (< x 70) + (kill-window) + (and (< 150 x) (< x 190)) + (launch) + (and (< 285 x) (< x 330)) + (carousel) + false)))))) + (kiwmi:on "view" (fn [view]