@@ -134,10 +134,7 @@ function isCuttable(focused: IFocusableNode): boolean {
134134 */
135135export function registerCopy ( ) {
136136 const ctrlC = ShortcutRegistry . registry . createSerializedKey ( KeyCodes . C , [
137- KeyCodes . CTRL ,
138- ] ) ;
139- const metaC = ShortcutRegistry . registry . createSerializedKey ( KeyCodes . C , [
140- KeyCodes . META ,
137+ KeyCodes . CTRL_CMD ,
141138 ] ) ;
142139
143140 const copyShortcut : KeyboardShortcut = {
@@ -179,7 +176,7 @@ export function registerCopy() {
179176 : undefined ;
180177 return ! ! clipboard . copy ( focused , copyCoords ) ;
181178 } ,
182- keyCodes : [ ctrlC , metaC ] ,
179+ keyCodes : [ ctrlC ] ,
183180 } ;
184181 ShortcutRegistry . registry . register ( copyShortcut ) ;
185182}
@@ -189,10 +186,7 @@ export function registerCopy() {
189186 */
190187export function registerCut ( ) {
191188 const ctrlX = ShortcutRegistry . registry . createSerializedKey ( KeyCodes . X , [
192- KeyCodes . CTRL ,
193- ] ) ;
194- const metaX = ShortcutRegistry . registry . createSerializedKey ( KeyCodes . X , [
195- KeyCodes . META ,
189+ KeyCodes . CTRL_CMD ,
196190 ] ) ;
197191
198192 const cutShortcut : KeyboardShortcut = {
@@ -224,7 +218,7 @@ export function registerCut() {
224218 }
225219 return ! ! copyData ;
226220 } ,
227- keyCodes : [ ctrlX , metaX ] ,
221+ keyCodes : [ ctrlX ] ,
228222 } ;
229223
230224 ShortcutRegistry . registry . register ( cutShortcut ) ;
@@ -235,10 +229,7 @@ export function registerCut() {
235229 */
236230export function registerPaste ( ) {
237231 const ctrlV = ShortcutRegistry . registry . createSerializedKey ( KeyCodes . V , [
238- KeyCodes . CTRL ,
239- ] ) ;
240- const metaV = ShortcutRegistry . registry . createSerializedKey ( KeyCodes . V , [
241- KeyCodes . META ,
232+ KeyCodes . CTRL_CMD ,
242233 ] ) ;
243234
244235 const pasteShortcut : KeyboardShortcut = {
@@ -309,7 +300,7 @@ export function registerPaste() {
309300 const centerCoords = new Coordinate ( left + width / 2 , top + height / 2 ) ;
310301 return ! ! clipboard . paste ( copyData , targetWorkspace , centerCoords ) ;
311302 } ,
312- keyCodes : [ ctrlV , metaV ] ,
303+ keyCodes : [ ctrlV ] ,
313304 } ;
314305
315306 ShortcutRegistry . registry . register ( pasteShortcut ) ;
@@ -320,10 +311,7 @@ export function registerPaste() {
320311 */
321312export function registerUndo ( ) {
322313 const ctrlZ = ShortcutRegistry . registry . createSerializedKey ( KeyCodes . Z , [
323- KeyCodes . CTRL ,
324- ] ) ;
325- const metaZ = ShortcutRegistry . registry . createSerializedKey ( KeyCodes . Z , [
326- KeyCodes . META ,
314+ KeyCodes . CTRL_CMD ,
327315 ] ) ;
328316
329317 const undoShortcut : KeyboardShortcut = {
@@ -342,7 +330,7 @@ export function registerUndo() {
342330 e . preventDefault ( ) ;
343331 return true ;
344332 } ,
345- keyCodes : [ ctrlZ , metaZ ] ,
333+ keyCodes : [ ctrlZ ] ,
346334 } ;
347335 ShortcutRegistry . registry . register ( undoShortcut ) ;
348336}
@@ -353,13 +341,10 @@ export function registerUndo() {
353341 */
354342export function registerRedo ( ) {
355343 const ctrlShiftZ = ShortcutRegistry . registry . createSerializedKey ( KeyCodes . Z , [
356- KeyCodes . CTRL ,
357- KeyCodes . SHIFT ,
358- ] ) ;
359- const metaShiftZ = ShortcutRegistry . registry . createSerializedKey ( KeyCodes . Z , [
360- KeyCodes . META ,
344+ KeyCodes . CTRL_CMD ,
361345 KeyCodes . SHIFT ,
362346 ] ) ;
347+
363348 // Ctrl-y is redo in Windows. Command-y is never valid on Macs.
364349 const ctrlY = ShortcutRegistry . registry . createSerializedKey ( KeyCodes . Y , [
365350 KeyCodes . CTRL ,
@@ -381,7 +366,7 @@ export function registerRedo() {
381366 e . preventDefault ( ) ;
382367 return true ;
383368 } ,
384- keyCodes : [ ctrlShiftZ , metaShiftZ , ctrlY ] ,
369+ keyCodes : [ ctrlShiftZ , ctrlY ] ,
385370 } ;
386371 ShortcutRegistry . registry . register ( redoShortcut ) ;
387372}
0 commit comments