How to handle (raw) key events in editor


#1

Hi

I’m trying to listen keypress events like this:

        atom.workspaceView.eachEditorView (editorView) ->
          editorView.on 'keypress', (event) ->
            e = editorView.getEditor()
            # do something based on key

I can see “normal” keys, but no Ctrl+key commands. Is there any way to handle this?


Going to make a package with cool typing effects! Where should i start?
#2

I don’t know if this will help, but I stumbled across @ProbablyCorey’s package aural-coding. In that package there is this code:

that hooks into the low-level keydown and keyup events. I would think that this would be a way to do what you’re asking.


Remap 'command-palette:toggle' to double shift
#3

Thanks!
Actually the solution was to use “keyup” instead of keypress, I can use them even with editorView as well