penpot/src/uxbox/main/ui/keyboard.cljs
Andrey Antukh 929a0a84da
Restructure the source directory tree.
In order to provide space for other applications
that shares source with the main app.
2016-06-14 17:39:44 +03:00

19 lines
280 B
Clojure

(ns uxbox.main.ui.keyboard)
(defn is-keycode?
[keycode]
(fn [e]
(= (.-keyCode e) keycode)))
(defn ctrl?
[event]
(.-ctrlKey event))
(defn shift?
[event]
(.-shiftKey event))
(def esc? (is-keycode? 27))
(def enter? (is-keycode? 13))
(def space? (is-keycode? 32))