feat(stage): 多选快捷键改成ctrl/cmd

This commit is contained in:
roymondchen 2022-08-08 13:19:37 +08:00 committed by jia000
parent 8c5250403b
commit 3d1a803ec9

View File

@ -108,11 +108,16 @@ export default class StageMask extends Rule {
this.content.addEventListener('wheel', this.mouseWheelHandler);
this.content.addEventListener('mousemove', this.highlightHandler);
this.content.addEventListener('mouseleave', this.mouseLeaveHandler);
KeyController.global.keydown('shift', (e) => {
const isMac = /mac os x/.test(navigator.userAgent.toLowerCase());
const ctrl = isMac ? 'meta' : 'ctrl';
KeyController.global.keydown(ctrl, (e) => {
e.inputEvent.preventDefault();
this.isMultiSelectStatus = true;
});
KeyController.global.keyup('shift', (e) => {
KeyController.global.keyup(ctrl, (e) => {
e.inputEvent.preventDefault();
this.isMultiSelectStatus = false;
});