coolwanglu / neovim-e

Electron UI for Neovim
MIT License
271 stars 29 forks source link

<C-c> and similar not forwarded to vim #3

Closed neojski closed 9 years ago

neojski commented 9 years ago

I expected <c-c> to work but it looks like atom-shell is preventing then somehow. They don't show-up in the addEventListener callback.

coolwanglu commented 9 years ago

I try to type :bla and then <C-c>, and the command-line is cancelled as expected. It might be the differences of the behavior of Chrome in different OSes. Which OS are you using?

rygwdn commented 9 years ago

<C-space> doesn't appear to get forwarded to neovim either.

neojski commented 9 years ago

:bla<C-c> does not work either. I'm using archlinux. It looks like <C-r> works. I'm not sure why this is happening.

coolwanglu commented 9 years ago

I see, I think that the key codes might need special checks across different OSes. I think I'll need to collect more information, or to find a library for this task.

coolwanglu commented 9 years ago

@rygwdn yeah, I found that both charCode and keyCode are 0 for the keypress event of <C-space>, I might need to capture keydown events for this.

coolwanglu commented 9 years ago

I have integrated the functions of atom-keymap, hopefully it's better now. But a side-effect is that caps-lock is now ignored. It has been pushed to the master branch, please give a try.

rygwdn commented 9 years ago

@coolwanglu I tried out the master branch and unfortunately <C-Space> still does nothing.

rygwdn commented 9 years ago

disregard that last comment, it does indeed work! (I forgot to re-generate the JS from coffeescript).

coolwanglu commented 9 years ago

@rygwdn great!

coolwanglu commented 9 years ago

@neojski Could you test <c-c>?

neojski commented 9 years ago

Works now, thanks!