Skip to content

Commit a4e6166

Browse files
authored
fix!: Remove alt+key commands (#8961)
* fix: Remove the alt+key commands * Remove tests for alt+key combos
1 parent dd3133b commit a4e6166

File tree

2 files changed

+5
-40
lines changed

2 files changed

+5
-40
lines changed

core/shortcut_items.ts

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,6 @@ export function registerCopy() {
9999
const ctrlC = ShortcutRegistry.registry.createSerializedKey(KeyCodes.C, [
100100
KeyCodes.CTRL,
101101
]);
102-
const altC = ShortcutRegistry.registry.createSerializedKey(KeyCodes.C, [
103-
KeyCodes.ALT,
104-
]);
105102
const metaC = ShortcutRegistry.registry.createSerializedKey(KeyCodes.C, [
106103
KeyCodes.META,
107104
]);
@@ -138,7 +135,7 @@ export function registerCopy() {
138135
: null;
139136
return !!copyData;
140137
},
141-
keyCodes: [ctrlC, altC, metaC],
138+
keyCodes: [ctrlC, metaC],
142139
};
143140
ShortcutRegistry.registry.register(copyShortcut);
144141
}
@@ -150,9 +147,6 @@ export function registerCut() {
150147
const ctrlX = ShortcutRegistry.registry.createSerializedKey(KeyCodes.X, [
151148
KeyCodes.CTRL,
152149
]);
153-
const altX = ShortcutRegistry.registry.createSerializedKey(KeyCodes.X, [
154-
KeyCodes.ALT,
155-
]);
156150
const metaX = ShortcutRegistry.registry.createSerializedKey(KeyCodes.X, [
157151
KeyCodes.META,
158152
]);
@@ -197,7 +191,7 @@ export function registerCut() {
197191
}
198192
return false;
199193
},
200-
keyCodes: [ctrlX, altX, metaX],
194+
keyCodes: [ctrlX, metaX],
201195
};
202196

203197
ShortcutRegistry.registry.register(cutShortcut);
@@ -210,9 +204,6 @@ export function registerPaste() {
210204
const ctrlV = ShortcutRegistry.registry.createSerializedKey(KeyCodes.V, [
211205
KeyCodes.CTRL,
212206
]);
213-
const altV = ShortcutRegistry.registry.createSerializedKey(KeyCodes.V, [
214-
KeyCodes.ALT,
215-
]);
216207
const metaV = ShortcutRegistry.registry.createSerializedKey(KeyCodes.V, [
217208
KeyCodes.META,
218209
]);
@@ -245,7 +236,7 @@ export function registerPaste() {
245236
const centerCoords = new Coordinate(left + width / 2, top + height / 2);
246237
return !!clipboard.paste(copyData, copyWorkspace, centerCoords);
247238
},
248-
keyCodes: [ctrlV, altV, metaV],
239+
keyCodes: [ctrlV, metaV],
249240
};
250241

251242
ShortcutRegistry.registry.register(pasteShortcut);
@@ -258,9 +249,6 @@ export function registerUndo() {
258249
const ctrlZ = ShortcutRegistry.registry.createSerializedKey(KeyCodes.Z, [
259250
KeyCodes.CTRL,
260251
]);
261-
const altZ = ShortcutRegistry.registry.createSerializedKey(KeyCodes.Z, [
262-
KeyCodes.ALT,
263-
]);
264252
const metaZ = ShortcutRegistry.registry.createSerializedKey(KeyCodes.Z, [
265253
KeyCodes.META,
266254
]);
@@ -277,7 +265,7 @@ export function registerUndo() {
277265
e.preventDefault();
278266
return true;
279267
},
280-
keyCodes: [ctrlZ, altZ, metaZ],
268+
keyCodes: [ctrlZ, metaZ],
281269
};
282270
ShortcutRegistry.registry.register(undoShortcut);
283271
}
@@ -291,10 +279,6 @@ export function registerRedo() {
291279
KeyCodes.SHIFT,
292280
KeyCodes.CTRL,
293281
]);
294-
const altShiftZ = ShortcutRegistry.registry.createSerializedKey(KeyCodes.Z, [
295-
KeyCodes.SHIFT,
296-
KeyCodes.ALT,
297-
]);
298282
const metaShiftZ = ShortcutRegistry.registry.createSerializedKey(KeyCodes.Z, [
299283
KeyCodes.SHIFT,
300284
KeyCodes.META,
@@ -316,7 +300,7 @@ export function registerRedo() {
316300
e.preventDefault();
317301
return true;
318302
},
319-
keyCodes: [ctrlShiftZ, altShiftZ, metaShiftZ, ctrlY],
303+
keyCodes: [ctrlShiftZ, metaShiftZ, ctrlY],
320304
};
321305
ShortcutRegistry.registry.register(redoShortcut);
322306
}

tests/mocha/keydown_test.js

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,6 @@ suite('Key Down', function () {
132132
Blockly.utils.KeyCodes.META,
133133
]),
134134
],
135-
[
136-
'Alt C',
137-
createKeyDownEvent(Blockly.utils.KeyCodes.C, [
138-
Blockly.utils.KeyCodes.ALT,
139-
]),
140-
],
141135
];
142136
// Copy a block.
143137
suite('Simple', function () {
@@ -223,12 +217,6 @@ suite('Key Down', function () {
223217
Blockly.utils.KeyCodes.META,
224218
]),
225219
],
226-
[
227-
'Alt Z',
228-
createKeyDownEvent(Blockly.utils.KeyCodes.Z, [
229-
Blockly.utils.KeyCodes.ALT,
230-
]),
231-
],
232220
];
233221
// Undo.
234222
suite('Simple', function () {
@@ -289,13 +277,6 @@ suite('Key Down', function () {
289277
Blockly.utils.KeyCodes.SHIFT,
290278
]),
291279
],
292-
[
293-
'Alt Shift Z',
294-
createKeyDownEvent(Blockly.utils.KeyCodes.Z, [
295-
Blockly.utils.KeyCodes.ALT,
296-
Blockly.utils.KeyCodes.SHIFT,
297-
]),
298-
],
299280
];
300281
// Undo.
301282
suite('Simple', function () {

0 commit comments

Comments
 (0)