Vimium: Non-Latin keyboard layouts do not initiate actions

Created on 27 Aug 2017  ·  16Comments  ·  Source: philc/vimium

When I switch to a non-Latin keyboard layout (e.g. Georgian, Russian, etc.), pressing the keys doesn't do anything. Is it possible to use something like this instead?

  • Chrome version: 60.0.3112.90 (Stable channel)
  • Vimium version: 1.59

Most helpful comment

In my opinion, this is a solved problem. VimFx used to have all sorts of keyboard layout issues, but we figured it out two years ago and haven't had a single bug about keyboard layouts since (except a few minor edge cases that we didn't think of straight away but were easy to fix). The important realization was that there's no one-size-fits-all solution. As I mentioned in https://github.com/philc/vimium/issues/2481#issuecomment-295609608 the trick is to provide a "Ignore keyboard layout" option (off by default in VimFx). Non-latin keyboard users tick that checkbox. End of story. Implementation wise, this means using _both_ event.key and event.code. VimFx's implementation can be found in vim-like-key-notation (which also contains more in-depth discussion/research); I'm sure that Vimium can use it as inspiration to do something similar. (Don't worry about the length readme, the code is just ~200 pretty straight-forward lines). As VimFx is now officially declared dead and links to Vimium-FF as an alternative, I expect people coming from VimFx to miss this feature in Vimium.

All 16 comments

Woah, sorry. Just searched and it has already been reported several times. Feel free to mark as a duplicate.

From here:

snapshot

@smblott-github Yes, I saw that. Is there a substitute for it?

The example on the page suggests a workable solution with a fallback.

It's not exactly satisfactory, but you could do something like this for whatever you language is. And you can leave the Latin bindings in place too.

Vimium is using event.key.

The example on the page suggests a workable solution with a fallback.

No. We're already using event.key (the default, on that page), and the other two are deprecated. In fact, the other two would never fire because Chrome defines event.key. Same for Firefox.

The ideal solution would be to allow mapping keys by code (event.code, but this will complicate the key handling code quite a bit, and I don't think anybody's attempted it so far.

We're already using event.key (the default, on that page), and the other two are deprecated. In fact, the other two would never fire because Chrome defines event.key. Same for Firefox.

That's really inconvenient for the purposes of Vimium. Almost nobody would want to fire different actions based on the layout they're using. Is there a more consistent method across the different layouts?

It's not exactly satisfactory, but you could do something like this for whatever you language is. And you can leave the Latin bindings in place too.

Yeah, I know that. Unfortunately, for many users, that's a bit of hassle.

BTW, may I add the key bindings for the layout of my language in the Wiki page, so others can copy and paste?

may I add the key bindings for the layout of my language in the Wiki

Please do!

Please do!

Done! And I know, it is messy (just like the Unicode).

Just checked and Facebook has working keyboard shortcuts on every layout. I haven't dug into the code yet.

Disable Vimium and hit Shift+/ (?) to see the shortcuts.

In my opinion, this is a solved problem. VimFx used to have all sorts of keyboard layout issues, but we figured it out two years ago and haven't had a single bug about keyboard layouts since (except a few minor edge cases that we didn't think of straight away but were easy to fix). The important realization was that there's no one-size-fits-all solution. As I mentioned in https://github.com/philc/vimium/issues/2481#issuecomment-295609608 the trick is to provide a "Ignore keyboard layout" option (off by default in VimFx). Non-latin keyboard users tick that checkbox. End of story. Implementation wise, this means using _both_ event.key and event.code. VimFx's implementation can be found in vim-like-key-notation (which also contains more in-depth discussion/research); I'm sure that Vimium can use it as inspiration to do something similar. (Don't worry about the length readme, the code is just ~200 pretty straight-forward lines). As VimFx is now officially declared dead and links to Vimium-FF as an alternative, I expect people coming from VimFx to miss this feature in Vimium.

Thanks, @lydell. I think that's the way to go, and the change should be fairly trivial in Vimium.

@lydell Just tried VimFx with the _Ignore keyboard layout_ setting enabled. Works flawlessly on different layouts. And non-QWERTY users would have custom key mappings anyway since Vim is primarily designed for QWERTY keyboards.

This even works with the link hints. Awesome!

I think the wiki page should be updated as well; some of the information is obsolete/outdated there.

Just found this. Thanks for brainstorming and implementing!

Was this page helpful?
0 / 5 - 0 ratings