Issue #2769Opened May 12, 2020by cartifon0 reactions

[QUESTION] - Event Handler from KeyMap should trigger the core events?

Question

Hey @artf, question, should the core commands be triggered when the keyMap is activated?

The situation:

I added this listeners:

 
function addCommands() {
  console.log(editor.Commands.getAll());
  editor.on('run:core:component-delete:before', function (options) {
    console.log('run:core:component-delete:before: ', options);
  });
  editor.on('run:core:component-delete', function (options) {
    console.log('run:core:component-delete: ', options);
  });
  editor.on('core:component-delete', function (options)  {
    console.log('core:component-delete: ', options);
  });
  const keyMaps = editor.Keymaps;
  console.log('keyMaps: ', keyMaps.getAll());
}

When I delete a component using the delete icon it calls my listener, but when I press the delete key, it does not trigger the listener... Am I doing anything wrong here?

You can check it here: https://www.w3schools.com/code/tryit.asp?filename=GEQBCR5CLYQF

Answers (1)

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.