diff --git a/lib/features/keyboard/BpmnKeyBindings.js b/lib/features/keyboard/BpmnKeyBindings.js index 9b6300b6..cf258a55 100644 --- a/lib/features/keyboard/BpmnKeyBindings.js +++ b/lib/features/keyboard/BpmnKeyBindings.js @@ -1,7 +1,7 @@ 'use strict'; -function BpmnKeyBindings(keyboard, spaceTool, lassoTool) { +function BpmnKeyBindings(keyboard, spaceTool, lassoTool, directEditing, selection) { keyboard.addListener(function(key, modifiers) { @@ -22,9 +22,20 @@ function BpmnKeyBindings(keyboard, spaceTool, lassoTool) { 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' ]; +BpmnKeyBindings.$inject = [ 'keyboard', 'spaceTool', 'lassoTool', 'directEditing', 'selection' ]; module.exports = BpmnKeyBindings; \ No newline at end of file