Closed ghost closed 7 years ago
Source:
(defmacro key-code [k] (u/gdx-field "Input$Keys" (u/key->upper k)))
Suppose you invoke (key-code :w) you will get 51 as expected
(key-code :w)
Now suppose you invoke (key-code w) and have or haven't bound w to anything. You get 51. This isn't expected.
(key-code w)
Because the macro parses symbols, its impossible to wrap a function around it. For instance:
[(key-code :a) (key-code :b) (key-code :c) (key-code :d)] [29 30 31 32]
(map (fn [a] (key-code a)) [:a :b :c :d]) [29 29 29 29]
Pull request for fix: #106
Source:
Suppose you invoke
(key-code :w)
you will get 51 as expectedNow suppose you invoke
(key-code w)
and have or haven't bound w to anything. You get 51. This isn't expected.Because the macro parses symbols, its impossible to wrap a function around it. For instance: