From ba2f32d986cd778a3a69d78d2db7e5482462f205 Mon Sep 17 00:00:00 2001 From: oakes Date: Wed, 2 Apr 2014 00:19:52 -0400 Subject: [PATCH] Add key-pressed? --- doclet/resources/classes.edn | 2 +- src/play_clj/core_basics.clj | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/doclet/resources/classes.edn b/doclet/resources/classes.edn index c6d87fc..bdd64db 100644 --- a/doclet/resources/classes.edn +++ b/doclet/resources/classes.edn @@ -100,7 +100,7 @@ "ImageTextButton.ImageTextButtonStyle" {"style :image-text-button" :constructors} "Input" {"input!" :methods} "Input.Keys" {"key-code" :static-fields - "pressed?" :static-fields} + "key-pressed?" :static-fields} "Interpolation" {"interpolation" :static-classes} "Intersector" {"intersector!" :static-methods} "IntAttribute" {"attribute :int" :constructors diff --git a/src/play_clj/core_basics.clj b/src/play_clj/core_basics.clj index f05016a..0a2bb9a 100644 --- a/src/play_clj/core_basics.clj +++ b/src/play_clj/core_basics.clj @@ -103,18 +103,18 @@ [k] `~(u/gdx-field "Input$Keys" (u/key->upper k))) -(defmacro pressed? +(defmacro key-pressed? "Returns a boolean indicating if the key cooresponding to `k` is being pressed. - (pressed? :a) - (pressed? :page-down)" + (key-pressed? :a) + (key-pressed? :page-down)" [k] `(input! :is-key-pressed (key-code ~k))) (defmacro is-pressed? - "Deprecated. Please use `pressed?` instead." + "Deprecated. Please use `key-pressed?` instead." [k] - `(pressed? ~k)) + `(key-pressed? ~k)) (defn ^:private add-input! [^InputProcessor p]