1.2.0 permalink Arrow_down_16x16

add-key-typed-listener

clojure.contrib.swing-utils

  • (add-key-typed-listener component f & args)
Adds a KeyListener to component that only responds to KeyTyped events.
When a key is typed, f is invoked with the KeyEvent as its first argument
followed by args. Returns the listener.

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/contrib/swing_utils.clj:33 top

(defn add-key-typed-listener
  "Adds a KeyListener to component that only responds to KeyTyped events.
  When a key is typed, f is invoked with the KeyEvent as its first argument
  followed by args. Returns the listener."
  [component f & args]
  (let [listener (proxy [KeyAdapter] []
                   (keyTyped [event] (apply f event args)))]
    (.addKeyListener component listener)
    listener))
Vars in clojure.contrib.swing-utils/add-key-typed-listener: defn let
Used in 0 other vars

Comments top

No comments for add-key-typed-listener. Log in to add a comment.