From 29149f398986620cf13ba1fc4d2d7cca139bead0 Mon Sep 17 00:00:00 2001 From: troido Date: Fri, 29 Dec 2017 22:40:24 +0100 Subject: keybinding macros have their own file and selectors can now be used! --- asciifarm/client/keymacros.hy | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 asciifarm/client/keymacros.hy (limited to 'asciifarm/client/keymacros.hy') diff --git a/asciifarm/client/keymacros.hy b/asciifarm/client/keymacros.hy new file mode 100644 index 0000000..8b9952e --- /dev/null +++ b/asciifarm/client/keymacros.hy @@ -0,0 +1,15 @@ + +(defmacro send [data] + `(fn [client] (client.send ~data))) + +(defmacro input [action] + `(send ["input" ~action])) + +(defmacro doall [actions] + `(fn [client] (for [action ~actions] (action client)))) + +(defmacro selector [name] + `(.getSelector (.getDisplay client) ~name)) + +(defmacro selectorvalue [name] + `(.getValue (selector ~name))) -- cgit