Merge pull request #740 from metamaps/feature/ctrl-or-meta

make all Ctrl shortcuts also work with Meta (Cmd on OSX)
This commit is contained in:
Devin Howard 2016-10-08 00:07:07 +08:00 committed by GitHub
commit dc55bae243

View file

@ -41,7 +41,7 @@ const Listeners = {
if (!creatingTopic) Visualize.mGraph.canvas.translate(0, 20) if (!creatingTopic) Visualize.mGraph.canvas.translate(0, 20)
break break
case 65: // if a or A is pressed case 65: // if a or A is pressed
if (e.ctrlKey) { if (e.ctrlKey || e.metaKey) {
Control.deselectAllNodes() Control.deselectAllNodes()
Control.deselectAllEdges() Control.deselectAllEdges()
@ -55,13 +55,13 @@ const Listeners = {
break break
case 68: // if d or D is pressed case 68: // if d or D is pressed
if (e.ctrlKey) { if (e.ctrlKey || e.metaKey) {
e.preventDefault() e.preventDefault()
Control.deleteSelected() Control.deleteSelected()
} }
break break
case 69: // if e or E is pressed case 69: // if e or E is pressed
if (e.ctrlKey && Active.Map) { if ((e.ctrlKey || e.metaKey) && Active.Map) {
e.preventDefault() e.preventDefault()
JIT.zoomExtents(null, Visualize.mGraph.canvas) JIT.zoomExtents(null, Visualize.mGraph.canvas)
break break
@ -79,14 +79,14 @@ const Listeners = {
} }
break break
case 72: // if h or H is pressed case 72: // if h or H is pressed
if (e.ctrlKey) { if (e.ctrlKey || e.metaKey) {
e.preventDefault() e.preventDefault()
Control.hideSelectedNodes() Control.hideSelectedNodes()
Control.hideSelectedEdges() Control.hideSelectedEdges()
} }
break break
case 77: // if m or M is pressed case 77: // if m or M is pressed
if (e.ctrlKey) { if (e.ctrlKey || e.metaKey) {
e.preventDefault() e.preventDefault()
Control.removeSelectedNodes() Control.removeSelectedNodes()
Control.removeSelectedEdges() Control.removeSelectedEdges()
@ -111,7 +111,7 @@ const Listeners = {
} }
break break
case 191: // if / is pressed case 191: // if / is pressed
if (e.ctrlKey) { if (e.ctrlKey || e.metaKey) {
Search.focus() Search.focus()
} }
break break