Start transitioning :keycode to :key so it is consistent with :button

This commit is contained in:
oakes
2014-05-09 20:42:17 -04:00
parent ccbc2f4db3
commit a1f269a0bf
2 changed files with 4 additions and 4 deletions

View File

@@ -133,7 +133,7 @@ via the screen map.
(defscreen my-screen
:on-key-down ; a key was pressed
(fn [screen entities]
(println (:keycode screen)) ; the code of the key (see key-code)
(println (:key screen)) ; the code of the key (see key-code)
entities)
:on-key-typed ; a key was typed
(fn [screen entities]
@@ -141,7 +141,7 @@ via the screen map.
entities)
:on-key-up ; a key was released
(fn [screen entities]
(println (:keycode screen)) ; the code of the key (see key-code)
(println (:key screen)) ; the code of the key (see key-code)
entities)
:on-mouse-moved ; the mouse was moved without pressing any buttons
(fn [screen entities]

View File

@@ -8,13 +8,13 @@
execute-fn!]
(reify InputProcessor
(keyDown [this k]
(execute-fn! on-key-down :keycode k)
(execute-fn! on-key-down :key k :keycode k)
false)
(keyTyped [this c]
(execute-fn! on-key-typed :character c)
false)
(keyUp [this k]
(execute-fn! on-key-up :keycode k)
(execute-fn! on-key-up :key k :keycode k)
false)
(mouseMoved [this sx sy]
(execute-fn! on-mouse-moved :input-x sx :input-y sy)