๐Ÿ“œ โฌ†๏ธ โฌ‡๏ธ

Creating a Bashkir layout for Mac OS X

Changing the operating system or device, if you write in some not very common language, for example, Bashkir - it is always a challenge. Therefore, people still sit on Windows XP, with crooked custom layouts in the registry and equally crooked "Bashkir" fonts. After all, even though it is crooked, it works. For many years I sat on Windows and somehow did not even recall the existence of the problem, but when I relocated to a Mac, I found that by default in OS X there is no Bashkir layout. I went to look for custom on the Internet, where I was also disappointed. How so, like so many years have passed? In the end, as it once was with Android, I decided to do everything on my own.

In fact, there are problems not only among the Bashkirs, more numerous peoples still do not have their own layouts in the new OS or release them with a long delay. Therefore, I will try to describe the creation process to help the same as I enthusiasts.

image
')


Bashkir alphabet


In order to better represent what will be discussed further, first take a look at the Bashkir alphabet. In total there are 42 letters in it, of which 33 are letters of the Russian alphabet + 9 additional. In my opinion - this is a lot, especially since some letters are used only for borrowing from Russian. Such redundancy does not allow you to comfortably fit on the keyboards. In general, many peoples in the former USSR who have experienced the influence of Stalinism have the same problem.
image

Principles used when creating layouts


Before you begin work, you need to try to formulate simple principles that can be repelled and applied in moments of doubt. In my case, a part of the initial principles did not take root and fell off, faced with reality, I will tell about them below. But those that remain:
  1. Most people are accustomed to the standard layout in Windows, first released on Vista (hereinafter, PC layout). Not everything is perfect in it, it is not the most convenient, but it has already taken root. Therefore, in order to make the working tool as fast as possible, I pushed away from it. And the original layout, which takes into account the real frequency of letters in a language, is the task of the near future.
    image
  2. Compatibility of additional (typographical) characters with the English layout. Very handy when you see what you can type on the physical keyboard. In the Russian layout, many signs have found a place for themselves by the residual principle (and less), so we try not to focus on it (this applies only to additional characters).
  3. The numeric keypad goes under Option (Alt). Yes, at first glance, this is a very dubious decision. But there is no other choice, because the letters are used much more often.
  4. It is important that with the help of the Bashkir layout you could type texts in Russian without switching.


Design


Before you start working in the editor, you need to list and draw all the states in which the keyboard can be. These states depend on the modifier keystrokes, such as Command (cmd), Shift (), Control (ctrl), Option (alt), and Caps Lock. In the case of the Bashkir keyboard, I have the following states:

  1. The Bashkir alphabet is lowercase + basic punctuation - this is the standard state, the default;
  2. Bashkir uppercase + main punctuation marks - Caps Lock;
  3. The letters of the alphabet capital + main punctuation marks 2 - Shift;
  4. English qwerty lowercase (for commands and hotkeys, identical to the English layout) - Command;
  5. English QWERTY uppercase (identical to English layout) - Command + Shift;
  6. Additional characters + numbers - Option;
  7. Additional characters 2 - Option + Shift;
  8. Additional characters (identical to the English layout) - Control.

Honestly, in the course of the work, I constantly experimented and the states changed, added and removed. For example, I tried to leave the numbers only in the state with pressed Command, but during the test it did not work, the text editor did not want to type text and waited for a command from the user. In the end, won simple and familiar solutions.

Work in the editor


To create the layouts, I used the free Ukelele program released by the SIL community, which is known, for example, by developing good free fonts and language software.

The file was taken as the basis of the existing Russian layout YSTUKEN. There are 2 ways to do this: first, select Russian as the input source of the OS, then open the program in the File - New From Current Input Source menu (that is, new from the current input source); second, open the layout file that comes with the program System Keybords / Cyrillic / Russian.keylayout

All work happens in the visual editor, it is easy and convenient. To assign a key to a key, double-click the virtual keyboard button. To edit the state of the layout with the included modifier, you just need to press the modifier key, instead of the standard state, the state corresponding to the modifier will appear. In order not to suffer constantly keeping the key pressed, turn on sticking in the Menu - View - Sticky Modifiers.

An overview of all created states can be opened using command + shift + m (in the screenshot above, the numbering does not correspond to the one I asked at the beginning). Below is separately indicated which of the states is standard (default set). In the table we see which modifiers are used for each state.



You may need to create some kind of state yourself. To do this, click "+", and select which modifiers to use. Note that for the Shift, Option and Control keys you can assign the right or left key separately. My state turned out to be similar to those in the Russian layout.



After that, you need to choose which character set you will use.

Apple has released more than a dozen different types of keyboards, differing in key layout and standards. Therefore, it is necessary to constantly test the layout. A list of all keyboards opens in Menu - View - Keyboard Types.



Pay particular attention to the difference between ANSI and ISO types, the second one has more keys. For example, I had a problem that in modern Apple Wireless ISO keyboards, the โ€œ>โ€ key in the location of the โ€œ` โ€key has theโ€œ> โ€key next to the numbers, and when the user has an ANSI keyboard, the letter suddenly disappears. At the same time, if you move it to the key โ€œ` โ€, to ISO it would not be in a row of numbers, but in the neighborhood of I in the 4th row. In the end, while I had to leave the letter ำ˜ on both keys.



In one of the intermediate versions of the layout, I had the idea to add compatibility with another popular layout in the tower, where additional letters are typed via alt. But during testing, I realized that this is inconvenient.



Final layout diagram


Due to differences in the configurations of the physical Mac keyboard, it was not possible to keep the top row with the additional additional letters of the Bashkir alphabet exactly the same as in the PC-layout. For example, โ€œาขโ€ has moved to the โ€œNo.โ€ place, because โ€œNo.โ€ is definitely not a frequently used sign. I would like to ask the authors of the original layout, how he got there at all. The place of the colon is taken by a comma, because it is needed more often and marked on the physical keyboard. When you press Shift, a comma takes the place of a semicolon, and the point - a colon, is quite easy to remember.



With the states when I pressed Option and Option + Shift, I โ€œplayedโ€ the tag for the longest time. But they helped me figure out a few rules. Option moved all the numbers and signs of the top row (+ part of typographic characters shown on the physical keyboard) from the standard English layout, and Option + Shift from it the same as Shift. I tried my best to use mnemonic rules, for example, the number is on the N key, and the euro sign is on the Latin key E.



The states with the pressed Command, as well as Command + Shift, as planned, fully correspond to the standard English layout, with Shift + Control - the English Control. It is necessary for hot keys and keyboard navigation to work in the system and applications.



Adding an icon


First, you need to create a reduced copy of the flag corresponding to the language, 16x12 px in size (or 16x11 px depending on what is drawn on the flag) in the graphic editor and save it in PNG format.



You can convert all this into the native format of the Makovsky .icns icons using the fasticms program . After starting the program, a cube will appear on the screen where we drag the png file and save it as icns in the opened window.



To attach an icon to the layout go to Menu - Keyboard - Attach Icon File.

Setting advanced options


There are still a few more steps to be done before publishing the layout.

It is necessary to add the name of the layout, which will be displayed in the system (Menu โ€” Keyboard โ€” Set Keyboard Name). Examples of titles: ArmenianWesternQWERTY, Serbian-Latin and Turkish-QWERTY-PC. I called my version of Bashkir-PC.

Now you need to set the language, script, region and script version (Menu โ€” Keyboard โ€” Set Keyboard Name). Cyrillic is used in the Bashkir language.



Do not forget to control the version of your layout (Menu โ€” Keyboard โ€” Set Version Info).

That's all, now you can save files and use. Please note that along with the main layout file in the keylayout format, the icon file in icns with the same name must be next to it.



You can download and install the created Bashkir layout.
Installation instructions are on the project page.

Additional materials on the topic


Tatar layout is an example of a layout where additional letters are inserted through AtlGr.

Kyrgyz layout

Another instruction for creating layouts in Ukelele

You can read the training materials that come with the program (folder Ukelele Tutorial).

Source: https://habr.com/ru/post/189556/


All Articles