Did you know that the sadists invented the switching of layouts? Well, not sadists, but people who do not use it more often than once in two days.
Operating systems impart to us the habit of switching keyboard layouts. From Russian to English, from English to Russian. And someone else in Ukrainian, or another language. Someone uses combinations of alt-shift, someone ctrl-shift, someone else some. Everyone experiences inconvenience. The Internet is full of questions about how to hang up switching layouts to an unnecessary Caps Lock key (one key is not two). Various options are offered for different operating systems and different desktop environments. An indispensable attribute of any desktop of any operating system is an indicator of the current keyboard layout. People switch layouts, type letters in the wrong language, swear, switch again.
And what if someone told you that you
don't need to switch the keyboard layout at all ? No, I do not propose to place all the letters of two or three languages on one layout. What I want to say is much simpler and more universal, you just need to practice a little.
')
Suppose we need to write a few words in the search box of the search engine Goggle. Let's think of several algorithms for how different users can solve this problem.
1) Put the focus in the text field.
2) Recall which language is currently selected (hold garbage in the head).
3) Compare whether this is the language in which you want to print the request.
4) If not, calculate how many times you need to change the layout to set the desired language (if there are only two languages, the answer is always one time).
5) Toggle the layout the necessary number of times.
Or, another algorithm:
1) Put the focus in the text field.
2) Find on-screen indicator of the current layout.
3) Compare whether the language on the indicator on which you want to print the request.
4) and 5) are the same as in the previous case.
And some do this:
1) Put the focus in the text field.
2) Try to start typing the query (I'm lucky!).
3) Compare whether the language turned out, on which you want to print the request.
4) If not, erase the printed.
5) and 6) are the same as 4), 5) from the previous case.
Gloom yes And now the correct algorithm:
1) Put the focus in the text field.
2) Enable the desired layout.
Those. All these actions for finding out the current layout, indication and switching are complete nonsense. Layouts do not need to switch, layouts need to be included immediately before entering text.
Switching layouts is mode switching. We switch the mode, for example, at the bulb when we turn it on or off. We do this because it is important for us that the light bulb burns while we are in the room and does not interfere when we go to bed, or do not waste energy when we leave. In the case of the keyboard, we do not care which layout is chosen most of the time. While we do not type the text, it does not affect anything.
Therefore, it is more logical (well, it seems to me) to enter text not as a mode, but as an action. The action "I want to write in Russian" and the action - "I want to write in English." And instead of recognizing the previous, unnecessary state of the layout, always put the necessary one before entering text.
In words, everything is fine. But in fact?
I can please Microsoft Windows users, for them there is a working solution. At least under Windows XP 32-bit works just fine -
punto switcher . Yes, the irony of fate - an application that was conceived as a remedy for flaws in changing layouts as a mode, is great for changing layouts as a command. True, only for two languages. It is configured very simply - first, you need to turn off auto-switching. Second, select the appropriate switching method in the first setup dialog:
Personally, I chose the left ctrl - English, the right - Russian.
I admit honestly, I was not interested in this question for Linux users. But
Alexander Malyshev suggests that this can be done directly in
the keyboard configuration in Gnome. But, as
sevka_fedoroff notes, then these keys stop working as functional, which, of course, is not at all the case.
But for fans of poppies, I have no good news - despite the fact that there is a
Mac version of Punto Switcher , there is no necessary functionality in it. And other applications that I have tried, also do not allow to specify different keyboard shortcuts for different layouts. I myself was in a difficult situation, addicted to this method of changing layouts under Windows, and then going to Mac.
Added October 1: On Twitter, Max Zorin suggested that there is an extension for system settings, like
KeyRemap4MacBook . It allows you to do a lot of useful reassignments of keys, and can hang up switching layouts to ciphers or commands, almost like punto under Windows. The only pity is that it only switches strictly between the Russian and US layouts, and, let's say, Ilya Birman is no longer able to cope with the layout. But then I guessed to download the
latest unstable version and there was support for exactly this layout. But for some reason, for this you need to use abbreviations of two keys: the right command and the left key. There is no happiness in life. But now somehow it works.
What is the result
I can not say that this method of changing layouts is devoid of flaws. The most obvious one is the habit of holding down the ctrl key in advance in order to press a shortcut and then change your mind. In this case, as you can guess, there is an undesirable inclusion of the layout, perhaps not the one on which you just entered the text. But this flaw is not a flaw in the concept, but rather a flaw in modern keyboards, on which it is necessary to divide the keys for switching on layouts with function keys.
If you have ideas on how to make the inclusion of layouts for certain keys in Linux or Mac OS, write in the comments, be sure to add working methods to the topic.