Key map, action map, delete

I'd like to hook up the action where the user presses DELETE key at the end of one child, which deletes its next-sibling. I can't seem to capture this event no matter what I try. Any ideas?

(The goal is that when I press DELETE at the end of the child, the child gets concatenated (say, the child is just a node with a string property) with the next-sibling instead of just deleting the next sibling. Similarly when I press BACKSPACE at the beginning of a child, it concatenates with the prev-sibling. I can do the BACKSPACE part by hooking up the DELETE action in the action map, but I can't do the DELETE part.)
4 comments
You should be able to do that using action maps, but the following bug prevents you from doing it: http://youtrack.jetbrains.com/issue/MPS-16494.

going to correct it now ;-)
0
OOps. I was wrong. For now to handle delete action on child nodes you have to add action map processing delete onto the cell referencing child nodes from parent node (CellModel_RefNodeList).

So, currently you can attach action map handling any common actions onto a cell editing child link declaration in parent node. In this case all specified actions should be applied to all top-level child cells created inside this collection (top-level cells for child nodes).
0
Thanks for the workaround. I'll give that a try. Meanwhile, I find it really difficult to use Action maps and Key maps, and everytime it is basically a trial and error process.

Are there plans to improve the editor key maps / action maps so that they can be easily used and customizable at a lower level? One example use case would be a multiline string that exist in some languages such as Python, and it's really difficult to mimic a text like editor in MPS, one reason of which is the difficulty of using action/key maps.
0
Yes we are planning to improve editor description in MPS in the next release. I'm not sure we will do a lot around actions, but at lease we are going to document it a bit. :-)
0

Please sign in to leave a comment.