How to use the diagram-js/lib/features/keyboard/KeyboardUtil.isCmd function in diagram-js

To help you get started, we’ve selected a few diagram-js examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github bpmn-io / cmmn-js / lib / features / snapping / CmmnConnectSnapping.js View on Github external
], HIGHER_PRIORITY, function(event) {
    var context = event.context,
        start = context.start,
        hover = context.hover,
        canExecute = context.canExecute;

    if (!canExecute) {
      return;
    }

    if (event.originalEvent && isCmd(event.originalEvent)) {
      return;
    }

    if (!context.initialConnectionStart) {
      context.initialConnectionStart = context.startPosition;
    }

    if (canExecute && isCenterSnapTarget(start)) {
      // snap start
      context.startPosition = mid(start);
    }

    if (canExecute && isCenterSnapTarget(hover)) {

      // snap hover
      snapToPosition(event, mid(hover));
github bpmn-io / bpmn-js / lib / features / snapping / BpmnConnectSnapping.js View on Github external
], HIGHER_PRIORITY, function(event) {
    var context = event.context,
        canExecute = context.canExecute,
        start = context.start,
        hover = context.hover,
        source = context.source,
        target = context.target;

    // do NOT snap on CMD
    if (event.originalEvent && isCmd(event.originalEvent)) {
      return;
    }

    if (!context.initialConnectionStart) {
      context.initialConnectionStart = context.connectionStart;
    }

    // snap hover
    if (canExecute && hover) {
      snapToShape(event, hover, getTargetBoundsPadding(hover));
    }

    if (hover && isAnyType(canExecute, [
      'bpmn:Association',
      'bpmn:DataInputAssociation',
      'bpmn:DataOutputAssociation',
github zeebe-io / zeebe-modeler / client / src / app / KeyboardBindings.js View on Github external
_keyDownHandler = (event) => {
    let action = null;

    const { onAction } = this;

    const commandOrCtrl = isCommandOrControl(event);

    // copy
    if (commandOrCtrl && isCopy(event) && isEnabled(this.copy) && !hasRole(this.copy, 'copy')) {
      action = getAction(this.copy);
    }

    // cut
    if (commandOrCtrl && isCut(event) && isEnabled(this.cut) && !hasRole(this.cut, 'cut')) {
      action = getAction(this.cut);
    }

    // paste
    if (commandOrCtrl && isPaste(event) && isEnabled(this.paste) && !hasRole(this.paste, 'paste')) {
      action = getAction(this.paste);
    }
github zeebe-io / zeebe-modeler / client / src / app / tabs / bpmn / modeler / features / properties-panel-keyboard-bindings / PropertiesPanelKeyoardBindings.js View on Github external
function isRedo(event) {
  return isCommandOrControl(event) && (isKey(['y', 'Y'], event) || (isKey(['z', 'Z'], event) && isShift(event)));
}
github zeebe-io / zeebe-modeler / client / src / app / KeyboardBindings.js View on Github external
function isUndo(event) {
  return isKey(['z', 'Z'], event) && isCommandOrControl(event) && !isShift(event);
}
github zeebe-io / zeebe-modeler / client / src / app / KeyboardBindings.js View on Github external
function isCut(event) {
  return isKey(['x', 'X'], event) && isCommandOrControl(event);
}
github zeebe-io / zeebe-modeler / client / src / app / KeyboardBindings.js View on Github external
function isCopy(event) {
  return isKey(['c', 'C'], event) && isCommandOrControl(event);
}
github zeebe-io / zeebe-modeler / client / src / app / KeyboardBindings.js View on Github external
function isSelectAll(event) {
  return isKey(['a', 'A'], event) && isCommandOrControl(event);
}