Capture all key events in the editor.