summaryrefslogtreecommitdiff
path: root/asciifarm/client/keymacros.hy
diff options
context:
space:
mode:
authortroido <troido@hotmail.com>2017-12-29 22:40:24 +0100
committertroido <troido@hotmail.com>2017-12-29 22:40:24 +0100
commit29149f398986620cf13ba1fc4d2d7cca139bead0 (patch)
treed8f7915bdf656599319ab5dd63d3873b9f8c59a3 /asciifarm/client/keymacros.hy
parenta1c60cfcb63b013f575943e17854cf205f8db913 (diff)
keybinding macros have their own file and selectors can now be used!
Diffstat (limited to 'asciifarm/client/keymacros.hy')
-rw-r--r--asciifarm/client/keymacros.hy15
1 files changed, 15 insertions, 0 deletions
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)))