fix: non-mac users will use Ctrl instead of Alt for selecting blocks

pull/5127/head^2
Tienson Qin 2022-05-22 00:42:34 +08:00
parent c96eca3e88
commit 1418bfb205
3 changed files with 9 additions and 3 deletions

View File

@ -1907,7 +1907,7 @@
(let [target (gobj/get e "target")
button (gobj/get e "buttons")
shift? (gobj/get e "shiftKey")
meta? (gobj/get e "metaKey")]
meta? (util/meta-key? e)]
(if (and meta? (not (state/get-edit-input-id)))
(do
(util/stop e)
@ -2013,7 +2013,7 @@
(state/in-selection-mode?)
(not (string/includes? content "```"))
(not (gobj/get e "shiftKey"))
(not (gobj/get e "metaKey")))
(not (util/meta-key? e)))
;; clear highlighted text
(util/clear-selection!)))}
(not slide?)

View File

@ -459,7 +459,7 @@
[e]
(state/hide-custom-context-menu!)
(when (and (not (gobj/get e "shiftKey"))
(not (gobj/get e "metaKey")))
(not (util/meta-key? e)))
(editor-handler/clear-selection!)))
(rum/defcs ^:large-vars/cleanup-todo sidebar <

View File

@ -1193,6 +1193,12 @@
(defn meta-key-name []
(if mac? "Cmd" "Ctrl")))
#?(:cljs
(defn meta-key? [e]
(if mac?
(gobj/get e "metaKey")
(gobj/get e "ctrlKey"))))
#?(:cljs
(defn right-click?
[e]