Do you type in Russian, Greek, Chinese or any other language that requires lots of characters not present in the standard en-US QWERTY layout? Tell me all about it! Stop reading this post if it gets too long, too technical or too specialized. You can still reply to what you’ve read so far (like up to this sentence
).
For almost all of my life, I’ve been using the Swedish version of the standard en-US QWERTY layout (henceforth just called “the en-US layout”), like most swedes do. In a nutshell, it is exactly like the en-US layout, except that the “å”, “ä” and “ö” letters have been shoved in and lots of punctuation characters have been shuffled around. Using this layout, you can type in Swedish, English, German, Spanish, French, etc. So most swedes use the sv-SE layout and nothing else. So I have very little experience from switching between layouts.
Here are some specific questions I’m interested in:
- How do you type in English? Do you switch to the en-US layout?
- Do you use more than one layout with non-latin characters? For example, as far as I understand many Russians use both a Russian and a Ukrainian layout. Why?
- Some punctuation characters, for instance, are present in all layouts you use, right? Are they on the same keys, or have you learned to use different keys for the same character depending on which language you type in? Doesn’t that bother you?
- What about keyboard shortcuts? For example, ctrl+a usually means “select all”. What if your current layout doesn’t have an “a” key? Are there programs that require you to switch to the en-US layout in order to use its keyboard shortcuts?
- Do you use vim? How does that work with your layout?
- Can you consider one of your layouts as your “main” layout?
- Do you think it is correct to reason like this: A Greek, who lives in Greece, uses the Greek layout for typing in Greek, and the en-US layout for typing in English (because that’s how you typically do it in Greece (is it?)), while a Greek, who has moved to Sweden also uses the Greek layout for typing in Greek, but the sv-SE layout for typing in English (because the sv-SE layout works fine for English too, which means one less layout to use). Likewise, a Greek who has moved to England might use the en-GB layout instead of en-US, right?
The reason I’m asking is that I’m one of the authors of the
VimFx Firefox extension, which adds vim-like keyboard shortcuts to Firefox. I’m trying to improve the keyboard layout support for it. Currently it only works best with the en-US layout (because we rely on the sucky “event.keyCode”, in case that means anything to you).
Thanks to Firefox 29 we now have the possibility to make things better (through “event.key”). We can now get the exact character that your keypress would produce. That would make the following possible, for example:
- Swedes will finally be able to type a “/” as they normally do to activate find mode (“/” is the default shortcut for find mode). That is, pressing shift+7. Currently, doing that does nothing at all. Instead they have to press a completely different key to activate find mode, or remap the shortcut to something else.
- Swedes will be able to use their special “å”, “ä” and “ö” keys for shortcuts.
The same is true for any user who uses a national layout that shuffles around the punctuation keys and adds a few national letters. So what’s the problem?
- If the user’s keyboard layout does not include a-z, the user won’t be able to use most commands (because most commands use only a-z).
- Users of multiple keyboard layouts can’t rely on muscle memory for the commands, because the characters might be on different keys in different layouts.
So a solution I’m thinking is that you should be able to specify a keyboard layout in VimFx. Choosing “auto” as the layout would use “event.key” like I talked about above—VimFx would use the character that would be typed by your keypress, depending on your current layout. Choosing “en-US” as the layout would map each physical key (one can determine which physical key was pressed using “event.code” (in Firefox 33, when it comes)) to the character that layout would produce, regardless of your current layout. Choosing “en-GB” would map each key according to the en-GB layout. “ru” to the a Russian layout etc. If the user’s layout isn’t listed, he could define it himself, and ask for it to be added to VimFx.
- Users of one single layout, that includes all the shorcuts to VimFx’s commands, would happily use “auto”. That includes English, Swedish, German, French etc. users.
- Users of multiple layouts (likely ones with non-latin characters), would choose one of “en-US”, “en-GB”, “ru” etc. The Greek in Greece from above might choose “en-US”, the Greek in Sweden might choose “sv-SE” and the Greek in England might choose “en-GB”. Then he can switch to the Greek layout while VimFx still thinks he is using the “en-US”, “sv-SE” or “en-GB” layout, respectively.
As a user of multiple layouts, do think the above is a good solution?