Start transitioning :keycode to :key so it is consistent with :button
This commit is contained in:
@@ -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]
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user