From b346323d0b141ab4e83b4a7e0f5ba49442a70466 Mon Sep 17 00:00:00 2001 From: Daniel Barlow Date: Sun, 8 May 2022 22:48:44 +0100 Subject: [PATCH] detect mouse clicks in bottom bar (hacky) --- rc.fnl | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/rc.fnl b/rc.fnl index aacbaf0..035e2a4 100644 --- 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]