[Editor] Fix few keyboard shortcuts on mac
This commit is contained in:
parent
9cc5260b68
commit
85f3e23e7f
@ -16,7 +16,7 @@
|
|||||||
// eslint-disable-next-line max-len
|
// eslint-disable-next-line max-len
|
||||||
/** @typedef {import("./annotation_editor_layer.js").AnnotationEditorLayer} AnnotationEditorLayer */
|
/** @typedef {import("./annotation_editor_layer.js").AnnotationEditorLayer} AnnotationEditorLayer */
|
||||||
|
|
||||||
import { bindEvents, ColorManager } from "./tools.js";
|
import { bindEvents, ColorManager, KeyboardManager } from "./tools.js";
|
||||||
import { shadow, unreachable } from "../../shared/util.js";
|
import { shadow, unreachable } from "../../shared/util.js";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -249,12 +249,17 @@ class AnnotationEditor {
|
|||||||
* @param {PointerEvent} event
|
* @param {PointerEvent} event
|
||||||
*/
|
*/
|
||||||
pointerdown(event) {
|
pointerdown(event) {
|
||||||
if (event.button !== 0) {
|
const isMac = KeyboardManager.platform.isMac;
|
||||||
|
if (event.button !== 0 || (event.ctrlKey && isMac)) {
|
||||||
// Avoid to focus this editor because of a non-left click.
|
// Avoid to focus this editor because of a non-left click.
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (event.ctrlKey || event.shiftKey) {
|
if (
|
||||||
|
(event.ctrlKey && !isMac) ||
|
||||||
|
event.shiftKey ||
|
||||||
|
(event.metaKey && isMac)
|
||||||
|
) {
|
||||||
this.parent.toggleSelected(this);
|
this.parent.toggleSelected(this);
|
||||||
} else {
|
} else {
|
||||||
this.parent.setSelected(this);
|
this.parent.setSelected(this);
|
||||||
|
@ -433,7 +433,7 @@ class AnnotationEditorUIManager {
|
|||||||
],
|
],
|
||||||
AnnotationEditorUIManager.prototype.delete,
|
AnnotationEditorUIManager.prototype.delete,
|
||||||
],
|
],
|
||||||
[["Escape"], AnnotationEditorUIManager.prototype.unselectAll],
|
[["Escape", "mac+Escape"], AnnotationEditorUIManager.prototype.unselectAll],
|
||||||
]);
|
]);
|
||||||
|
|
||||||
constructor(container, eventBus) {
|
constructor(container, eventBus) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user