Commit 49d8c75
authored
* refactor: Include key mappings in shortcuts
By adding the key mappings directly to the shortcuts, they will
be automatically mapped when the shortcuts are registered.
This follows current practice in Blockly core/shortcut_items.ts.
* refactor: use Array.prototype.includes instead of .indexOf
* refactor: Save original Toolbox.prototype.onShortcut method
… and restore it when removeShortcutHandlers is called.
* refactor: Put all KeyboardShortcuts in a dictionary object
This obviates the need to have separate functions to register
each of them, and makes it easy to ensure that we unregister
all of them when disposing.
This dictionary can be split into separate dictionaries for
different modes / sub modes as needed in future.
1 parent ad213f5 commit 49d8c75
File tree
2 files changed
+197
-498
lines changed- src
2 files changed
+197
-498
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
380 | 380 | | |
381 | 381 | | |
382 | 382 | | |
383 | | - | |
| 383 | + | |
384 | 384 | | |
385 | 385 | | |
386 | 386 | | |
| |||
457 | 457 | | |
458 | 458 | | |
459 | 459 | | |
460 | | - | |
| 460 | + | |
461 | 461 | | |
462 | 462 | | |
463 | 463 | | |
| |||
826 | 826 | | |
827 | 827 | | |
828 | 828 | | |
829 | | - | |
| 829 | + | |
830 | 830 | | |
831 | 831 | | |
832 | 832 | | |
| |||
1119 | 1119 | | |
1120 | 1120 | | |
1121 | 1121 | | |
1122 | | - | |
| 1122 | + | |
1123 | 1123 | | |
1124 | 1124 | | |
1125 | 1125 | | |
| |||
1135 | 1135 | | |
1136 | 1136 | | |
1137 | 1137 | | |
1138 | | - | |
| 1138 | + | |
1139 | 1139 | | |
1140 | 1140 | | |
1141 | 1141 | | |
| |||
1241 | 1241 | | |
1242 | 1242 | | |
1243 | 1243 | | |
1244 | | - | |
| 1244 | + | |
| 1245 | + | |
1245 | 1246 | | |
1246 | 1247 | | |
1247 | 1248 | | |
| |||
1262 | 1263 | | |
1263 | 1264 | | |
1264 | 1265 | | |
1265 | | - | |
1266 | | - | |
1267 | | - | |
| 1266 | + | |
| 1267 | + | |
| 1268 | + | |
| 1269 | + | |
1268 | 1270 | | |
1269 | 1271 | | |
1270 | 1272 | | |
| |||
0 commit comments