Separate keyboard shortcuts for canvas and selected elements

You have full control over how to interpret a key stroke.

If you intend to implement such a shortcut, simply check if an element is selected before deciding what to do in your BpmnKeyboardBindings override:

function MyCustomKeyboardBindings(selection, keyboard) {

  // contextual activate
  // E
  keyboard.addListener(function(context) {

    var event = context.keyEvent;

    if (selection.get().length) {
      // do this
    } else {
      // do that;
    }

    // indicate we handled the key stroke
    return true;
  });
}
2 Likes