Add key-pressed?
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user