Are you sure this is the only way to intercept key events? Can it not be done with `cm.on`?

We can't use `options.onKeyEvent` because that will interfere with CodeMirror clients that want to use this low level hook.