 
 (defn on-key-call
   "Takes a function and yields a View.OnKeyListener object that will invoke the
-  function.  This function must take the three arguments and return a boolean
-  value as described in on-key."
+  function.  This function must take the following three arguments:
+
+  view:     the view the key has been dispatched to
+  key-code: the code for the physical key that was pressed
+  event:    the KeyEvent object containing full information about the event
+
+  The function should evaluate to a truthy value if it has consumed the event.
+  Otherwise, it should evaluate to false or nil."
   [handler-fn]
   (reify android.view.View$OnKeyListener
     (onKey [this view key-code event]
-      (handler-fn view key-code event))))
+      (boolean (handler-fn view key-code event)))))
 
 (defmacro on-key
   "Takes a body of expressions and yields a View.OnKeyListener object that will

(defmacro on-click
  "Takes a body of expressions and yields a View.OnClickListener object that
  will invoke the body.  The body takes an implicit argument 'view' that is the
  view that was clicked." [& body]
  `(on-click-call (fn [~'view] ~@body)))

(defn on-create-context-menu-call
  "Takes a function and yields a View.OnCreateContextMenuListener object that
  will invoke the function.  This function must take the three arguments
  described in on-create-context-menu."
  [handler-fn]
  (reify android.view.View$OnCreateContextMenuListener
    (onCreateContextMenu [this menu view info]

(defn on-long-click-call
  "Takes a function and yields a View.OnLongClickListener object that will
  invoke the function.  This function must take one argument, the view that was
  clicked, and must evaluate to a truthy value if it has consumed the long
  click, false or nil otherwise."
  [handler-fn]
  (reify android.view.View$OnLongClickListener
    (onLongClick [this view]
      (boolean (handler-fn view)))))

(defmacro on-long-click
  "Takes a body of expressions and yields a View.OnLongClickListener object
  that will invoke the body.  The body takes an implicit argument 'view' that
  is the view that was clicked and held.  The body should also evaluate to a
  truthy value if it consumes the long click, false or nil otherwise."
  [& body]
  `(on-long-click-call (fn [~'view] ~@body)))

