excalidraw/src/actions/actionDeleteSelected.tsx

16 lines
438 B
TypeScript
Raw Normal View History

import { Action } from "./types";
import { deleteSelectedElements } from "../scene";
import { KEYS } from "../keys";
export const actionDeleteSelected: Action = {
name: "deleteSelectedElements",
perform: elements => {
return {
elements: deleteSelectedElements(elements)
};
},
contextItemLabel: "labels.delete",
contextMenuOrder: 3,
keyTest: event => event.key === KEYS.BACKSPACE || event.key === KEYS.DELETE
};