mirror of
https://github.com/penpot/penpot.git
synced 2025-07-22 10:07:14 +02:00
🎉 Zoom lense tool
This commit is contained in:
parent
a8c0d437ce
commit
c25cf043fa
10 changed files with 103 additions and 42 deletions
|
@ -6,13 +6,19 @@
|
|||
|
||||
(ns app.util.keyboard
|
||||
(:require
|
||||
[app.config :as cfg]))
|
||||
[app.config :as cfg]
|
||||
[cuerdas.core :as str]))
|
||||
|
||||
(defn is-key?
|
||||
[^string key]
|
||||
(fn [^js e]
|
||||
(= (.-key e) key)))
|
||||
|
||||
(defn is-key-ignore-case?
|
||||
[^string key]
|
||||
(fn [^js e]
|
||||
(= (str/upper (.-key e)) (str/upper key))))
|
||||
|
||||
(defn ^boolean alt?
|
||||
[^js event]
|
||||
(.-altKey event))
|
||||
|
@ -38,6 +44,7 @@
|
|||
(def esc? (is-key? "Escape"))
|
||||
(def enter? (is-key? "Enter"))
|
||||
(def space? (is-key? " "))
|
||||
(def z? (is-key-ignore-case? "z"))
|
||||
(def up-arrow? (is-key? "ArrowUp"))
|
||||
(def down-arrow? (is-key? "ArrowDown"))
|
||||
(def left-arrow? (is-key? "ArrowLeft"))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue