{"action":"created","issue":{"url":"https://api.github.com/repos/rhysd/neovim-component/issues/14","labels_url":"https://api.github.com/repos/rhysd/neovim-component/issues/14/labels{/name}","comments_url":"https://api.github.com/repos/rhysd/neovim-component/issues/14/comments","events_url":"https://api.github.com/repos/rhysd/neovim-component/issues/14/events","html_url":"https://github.com/rhysd/neovim-component/issues/14","id":126031753,"number":14,"title":"KeyDown events trigger the wrong vim key","user":{"login":"romgrk","id":1423607,"avatar_url":"https://avatars.githubusercontent.com/u/1423607?v=3","gravatar_id":"","url":"https://api.github.com/users/romgrk","html_url":"https://github.com/romgrk","followers_url":"https://api.github.com/users/romgrk/followers","following_url":"https://api.github.com/users/romgrk/following{/other_user}","gists_url":"https://api.github.com/users/romgrk/gists{/gist_id}","starred_url":"https://api.github.com/users/romgrk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/romgrk/subscriptions","organizations_url":"https://api.github.com/users/romgrk/orgs","repos_url":"https://api.github.com/users/romgrk/repos","events_url":"https://api.github.com/users/romgrk/events{/privacy}","received_events_url":"https://api.github.com/users/romgrk/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-01-11T20:40:01Z","updated_at":"2016-01-11T21:01:23Z","closed_at":null,"body":"The failing code is https://github.com/rhysd/neovim-component/blob/master/src/neovim/input.ts#L119\r\n```typescript\r\nvim_input += (special_char || String.fromCharCode(event.keyCode).toLowerCase()) + '>';\r\n```\r\nExample:\r\nPressing `alt` + `;` generates `<A-º>` where neovim usually gets `<A-;>`\r\n![screenshot from 2016-01-11 15-26-47](https://cloud.githubusercontent.com/assets/1423607/12245637/ca3d1242-b877-11e5-852f-ed60594e57a2.png)\r\n\r\nThe input is off for all non-letter keys. I recall discussing something like this in https://github.com/rhysd/neovim-component/issues/6, and again I wouldnt know exactly how this could be solved. The problem here is that `String.fromCharCode` takes a character code as argument, and what is being fed to it is a `keyCode`. I had already run in this exact problem when implementing a package for Atom, the only workaround I found then was to have a map of `keycodes`: `characters`, but there was no check of keyboard layout whatsoever, US layout was assumed all the way. That causes evident problems for i18n.\r\nI'll check if there is any possibility to retrieve the user keyboard layout."},"comment":{"url":"https://api.github.com/repos/rhysd/neovim-component/issues/comments/170688563","html_url":"https://github.com/rhysd/neovim-component/issues/14#issuecomment-170688563","issue_url":"https://api.github.com/repos/rhysd/neovim-component/issues/14","id":170688563,"user":{"login":"romgrk","id":1423607,"avatar_url":"https://avatars.githubusercontent.com/u/1423607?v=3","gravatar_id":"","url":"https://api.github.com/users/romgrk","html_url":"https://github.com/romgrk","followers_url":"https://api.github.com/users/romgrk/followers","following_url":"https://api.github.com/users/romgrk/following{/other_user}","gists_url":"https://api.github.com/users/romgrk/gists{/gist_id}","starred_url":"https://api.github.com/users/romgrk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/romgrk/subscriptions","organizations_url":"https://api.github.com/users/romgrk/orgs","repos_url":"https://api.github.com/users/romgrk/repos","events_url":"https://api.github.com/users/romgrk/events{/privacy}","received_events_url":"https://api.github.com/users/romgrk/received_events","type":"User","site_admin":false},"created_at":"2016-01-11T21:01:23Z","updated_at":"2016-01-11T21:01:23Z","body":"This is interesting:\r\nhttps://github.com/Microsoft/node-native-keymap"}}