Hello, so I have been trying for 2 hours to fire a keydown event on the TextEditor, so I’m asking for help on how to do this, and how to do it correctly. This is the test code.
eventA = Fn.keyEvent 'a', e // Fn.keyEvent -> returns a keydown event
eventEsc = Fn.keyEvent 'escape', e
atom.keymap.handleKeyboardEvent(eventA)
atom.keymap.handleKeyboardEvent(eventEsc)
Now, the weird thing is that the “Escape” event works perfectly, but the “A” event doesnt do shit. The eventA object is the following.
altKey: false, bubbles: true, cancelBubble: false, cancelable: true, charCode: 0, clipboardData: undefined, ctrlKey: false, currentTarget: Window, defaultPrevented: false, detail: 0, eventPhase: 0,
keyCode: 65, keyIdentifier: "U+41",
keyLocation: 0, metaKey: false, path: NodeList[0], repeat: false, returnValue: true, shiftKey: false, srcElement: null, target: atom-text-editor.editor.vim-mode.command-mode, timeStamp: 1428184193408, type: "keydown", view: null, which: 65
Any hint would be appreciated.