Add key-pressed?

This commit is contained in:
oakes
2014-04-02 00:19:52 -04:00
parent 0b0e1edffd
commit ba2f32d986
2 changed files with 6 additions and 6 deletions

View File

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

View File

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