mirror of
https://github.com/sartography/bpmn-js.git
synced 2025-01-14 11:04:15 +00:00
22536aff50
Key binding (for activation): l
41 lines
822 B
JavaScript
41 lines
822 B
JavaScript
'use strict';
|
|
|
|
|
|
function BpmnKeyBindings(keyboard, spaceTool, lassoTool, directEditing, selection) {
|
|
|
|
keyboard.addListener(function(key, modifiers) {
|
|
|
|
if (keyboard.hasModifier(modifiers)) {
|
|
return;
|
|
}
|
|
|
|
// S -> activate space tool
|
|
if (key === 83) {
|
|
spaceTool.activateSelection();
|
|
|
|
return true;
|
|
}
|
|
|
|
// L -> activate lasso tool
|
|
if (key === 108) {
|
|
lassoTool.activateSelection();
|
|
|
|
return true;
|
|
}
|
|
|
|
var currentSelection = selection.get();
|
|
|
|
// E -> activate direct editing
|
|
if (key === 69) {
|
|
if (currentSelection.length) {
|
|
directEditing.activate(currentSelection[0]);
|
|
}
|
|
|
|
return true;
|
|
}
|
|
});
|
|
}
|
|
|
|
BpmnKeyBindings.$inject = [ 'keyboard', 'spaceTool', 'lassoTool', 'directEditing', 'selection' ];
|
|
|
|
module.exports = BpmnKeyBindings; |