   (reify KeyListener
     (keyReleased [this e] nil)
     (keyTyped [this e]
-      (when (and @enable-advanced?
-                 (get #{"(" ")" "[" "]" "{" "}" "\""}
-                      (str (.getKeyChar e))))
+      (when (and @enable-advanced? (special-chars (str (.getKeyChar e))))
         (.consume e)))
     (keyPressed [this e]
       (when-not (.isConsumed e)
         (let [k (convert-key-event e)
-              p (exec-paredit k w buffer enable-default? enable-advanced?)]
+              p (exec-paredit! k w buffer enable-default? enable-advanced?)]
           (when p (.consume e)))))))
+
+(defn convert-input-method-event
+  [event]
+  ["M" (os-x-charmap (str (.first (.getText event))))])
 
 (defn input-method-event-handler
   [w buffer enable-default? enable-advanced?]
   (reify InputMethodListener
     (inputMethodTextChanged [this e]
       (let [k (convert-input-method-event e)
-            p (exec-paredit k w buffer enable-default? enable-advanced?)]
+            p (exec-paredit! k w buffer enable-default? enable-advanced?)]
         (when p (.consume e))))))
 
 (defn init-paredit!

                           :length (- (.getSelectionEnd widget)
                                      (.getSelectionStart widget))})))

(defn insert-result
  [w pe]
  (dorun
    (map #(if (= 0 (:length %))

   [nil "{"] :paredit-open-curly
   [nil "}"] :paredit-close-curly
   [nil "\b"] :paredit-backward-delete
   [nil "DEL"] :paredit-forward-delete
   [nil "\""] :paredit-doublequote ;; \"
   ; ["C" "K"] :paredit-kill
   ["M" "("] :paredit-wrap-round
   ; ["M" ")"] :paredit-close-round-and-newline
