I wish to detect when the enter key is pressed in blockly so that I can trigger a code evaluation, but I can't figure out how to detect key presses in Blockly. I see the event code such as the following:
function onFirstComment(event) {
if (event.type == Blockly.Events.CHANGE &&
event.element == 'comment' &&
!event.oldValue && event.newValue) {
alert('Congratulations on creating your first comment!')
workspace.removeChangeListener(onFirstComment);
}
}
workspace.addChangeListener(onFirstComment);
but the Blockly.Events.XXX only allows the following values:
One of Blockly.Events.CREATE, Blockly.Events.DELETE, Blockly.Events.CHANGE, Blockly.Events.MOVE, Blockly.Events.UI
Is there any way to drill in to one of these events and find out which key was pressed?