detect mouse clicks in bottom bar (hacky)

phoen
Daniel Barlow 2022-05-08 22:48:44 +01:00
parent 7ea1e9a0e7
commit b346323d0b
1 changed files with 25 additions and 0 deletions

25
rc.fnl
View File

@ -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]