   (if (not key-pressed)
     (reset! is-running (not @is-running))))
 
-(defn rotate
-  [app value tpf]
-  (if @is-running
-    (.rotate player 0 (* value (get-speed app)) 0)
-    (println "Press P to unpause")))
+(defmacro def-pausable
+  [name & body]
+  `(defn ~name
+     [~'app ~'value ~'tpf]
+     (if @is-running
+       (do ~@body)
+       (println "Press P to unpause"))))
 
-(defn right
-  [app value tpf]
-  (if @is-running
-    (let [v (.getLocalTranslation player)]
-      (.setLocalTranslation player
-                            (+ (.getX v) (* value (get-speed app)))
-                            (.getY v)
-                            (.getZ v)))
-    (println "Press P to unpause")))
+(def-pausable rotate
+  (.rotate player 0 (* value (get-speed app)) 0))
 
-(defn left
-  [app value tpf]
-  (if @is-running
-    (let [v (.getLocalTranslation player)]
-      (.setLocalTranslation player
-                            (- (.getX v) (* value (get-speed app)))
-                            (.getY v)
-                            (.getZ v)))
-    (println "Press P to unpause")))
+(def-pausable right
+  (let [v (.getLocalTranslation player)]
+    (.setLocalTranslation player
+                          (+ (.getX v) (* value (get-speed app)))
+                          (.getY v)
+                          (.getZ v))))
+
+(def-pausable left
+  (let [v (.getLocalTranslation player)]
+    (.setLocalTranslation player
+                          (- (.getX v) (* value (get-speed app)))
+                          (.getY v)
+                          (.getZ v))))
 
 (defn -main
   [& args]

;;;; http://jmonkeyengine.org/wiki/doku.php/jme3:beginner:hello_input_system

(ns maqueta.hello.input
  (:use (maqueta application assets))
  (:import (com.jme3.math ColorRGBA Vector3f)
           com.jme3.scene.Geometry
           com.jme3.scene.shape.Box))

      (doto (.setAccessible true))
      (.get app)))

(def player (make-box "Player" :x 1 :y 1 :z 1 :color ColorRGBA/Blue))

(def is-running (atom true))

