How to create keyboard macro

Hi, I was digging at the code and documentation trying to figuring out how to create a keyboard macro. I have looked at vim.js, and there is a couple of functions that are not documented:

  • dohandlebinding,
  • handleKeyBinding
  • lookupKey.

Is it possible to save all the keys pressed from keyboards events and then pass this sequence of keys to one of these functions in this case I’m trying dohandlebinding but it’s not working, nothing happens.

In a nutshell I want to store sequence of keys pressed then make codemirror execute the commands associated with them or handle the keyboards events appropriately as if the user has just typed them.
Thanks for your help

CodeMirror doesn’t really expose an interface for recording or dispatching keys. The vim code is using unstable internal functions. You could try triggerOnKeyDown and triggerOnKeyPress, but they are currently only used by the tests and might change in the future.

Thank you very much. I’ll take a look at those methods.