Add key-pressed?
This commit is contained in:
@@ -100,7 +100,7 @@
|
|||||||
"ImageTextButton.ImageTextButtonStyle" {"style :image-text-button" :constructors}
|
"ImageTextButton.ImageTextButtonStyle" {"style :image-text-button" :constructors}
|
||||||
"Input" {"input!" :methods}
|
"Input" {"input!" :methods}
|
||||||
"Input.Keys" {"key-code" :static-fields
|
"Input.Keys" {"key-code" :static-fields
|
||||||
"pressed?" :static-fields}
|
"key-pressed?" :static-fields}
|
||||||
"Interpolation" {"interpolation" :static-classes}
|
"Interpolation" {"interpolation" :static-classes}
|
||||||
"Intersector" {"intersector!" :static-methods}
|
"Intersector" {"intersector!" :static-methods}
|
||||||
"IntAttribute" {"attribute :int" :constructors
|
"IntAttribute" {"attribute :int" :constructors
|
||||||
|
|||||||
@@ -103,18 +103,18 @@
|
|||||||
[k]
|
[k]
|
||||||
`~(u/gdx-field "Input$Keys" (u/key->upper 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.
|
"Returns a boolean indicating if the key cooresponding to `k` is being pressed.
|
||||||
|
|
||||||
(pressed? :a)
|
(key-pressed? :a)
|
||||||
(pressed? :page-down)"
|
(key-pressed? :page-down)"
|
||||||
[k]
|
[k]
|
||||||
`(input! :is-key-pressed (key-code ~k)))
|
`(input! :is-key-pressed (key-code ~k)))
|
||||||
|
|
||||||
(defmacro is-pressed?
|
(defmacro is-pressed?
|
||||||
"Deprecated. Please use `pressed?` instead."
|
"Deprecated. Please use `key-pressed?` instead."
|
||||||
[k]
|
[k]
|
||||||
`(pressed? ~k))
|
`(key-pressed? ~k))
|
||||||
|
|
||||||
(defn ^:private add-input!
|
(defn ^:private add-input!
|
||||||
[^InputProcessor p]
|
[^InputProcessor p]
|
||||||
|
|||||||
Reference in New Issue
Block a user