Skip to content

Commit

Permalink
feat(stage): 多选快捷键改成ctrl/cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
roymondchen authored and jia000 committed Aug 8, 2022
1 parent 8c52504 commit 3d1a803
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/stage/src/StageMask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});
Expand Down

0 comments on commit 3d1a803

Please sign in to comment.