mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-04-25 11:06:47 +08:00
feat(stage): 多选快捷键改成ctrl/cmd
This commit is contained in:
parent
8c5250403b
commit
3d1a803ec9
@ -108,11 +108,16 @@ export default class StageMask extends Rule {
|
|||||||
this.content.addEventListener('wheel', this.mouseWheelHandler);
|
this.content.addEventListener('wheel', this.mouseWheelHandler);
|
||||||
this.content.addEventListener('mousemove', this.highlightHandler);
|
this.content.addEventListener('mousemove', this.highlightHandler);
|
||||||
this.content.addEventListener('mouseleave', this.mouseLeaveHandler);
|
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();
|
e.inputEvent.preventDefault();
|
||||||
this.isMultiSelectStatus = true;
|
this.isMultiSelectStatus = true;
|
||||||
});
|
});
|
||||||
KeyController.global.keyup('shift', (e) => {
|
KeyController.global.keyup(ctrl, (e) => {
|
||||||
e.inputEvent.preventDefault();
|
e.inputEvent.preventDefault();
|
||||||
this.isMultiSelectStatus = false;
|
this.isMultiSelectStatus = false;
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user