Unicode, Fonts and Keyboards

for Linux, Macintosh and Windows

 Logo
Charles W. Steitler
Contact

Citatio: Ch. W. Steitler, hethiter.net/: Unicode, Fonts & Keyboards (2021-08-09)

Initial Installation

Step 1

The keyboard layout (for example HPM-de.1.5.1.keylayout) must be saved in .../Library/Keyboard Layouts. Please note that there are multiple libraries within a single Mac OS system, and furthermore, the location of the proper library in which the keyboard layout must be saved can vary from among different Mac models and operating system versions. Three variations will be presented here.

Variant 1: hard drive volume

A library is located directly on the hard drive volume (usually named “Macintosh HD”).

[hard drive name]/Library/Keyboard Layouts

Variant 2: system folder of hard drive volume

Another library exists within the system folder located directly on the hard drive volume.

[hard drive name]/System/Library/Keyboard Layouts

*Example: This is the proper location for adding keyboard layouts to Mac OS 10.12.6 running on an iMac (late 2015, 27 inch). This variant does not work on Mac OS Big Sur 11.0 and higher, as the relevant directory is read only.*

Variant 3: individual user

A third possibility is the library of the individual user. The full path for this folder is given below; however, it can only be accessed within “Finder” by clicking on “Go” in the menu bar; then press “alt” and the folder “Library” will appear in the dropdown menu. This is the library of the user currently logged in.

[hard drive name]/Users/[user name]/Library/Keyboard Layouts

*Example: This is the proper location for adding keyboard layouts on Mac OS Big Sur 11.4, as well as older systems such as Mac OS 10.14.2 running on a MacBookAir (2017, 13 inch) or an iMac (late 2015, 27 inch).*

You may have to try more than one library folder before finding the correct one that will enable you to select the keyboard layout as an input source in step 3. You should now restart your computer to ensure that the keyboard layout is recognized by the operating system.

*Experienced has shown that updating to a newer operating system may require moving the keyboard layout to a different library folder. For example, for a MacBookAir (2017, 13 inch), an update from Mac OS 10.13 to 10.14 sporadically caused the keyboard layout to stop working, depending on which program was in use, and in some circumstances the keyboard layout could no longer be selected from the input menu of the menu bar. The solution was to move the keyboard layout, previously located in the library directly on the hard drive volume (Variant 1), to the individual user’s library (Variant 3). The keyboard layout was then deleted from its previous location, as well as from the input menu. After restarting, it was added again to the input menu (as described in Steps 2–3 below) after which it again functioned properly.*

Step 2

Go to System Preferences/Keyboard/Input Sources; select “+” in the lower left corner.

Step 3

A menu appears, from which you can choose a variety of keyboard layouts. If you do not immediately find the HPM layout, trying selecting “Others” from the lists of available languages. Click on the desired layout, then click “Add”. (If you cannot find the keyboard layout, trying saving it to the “Keyboard Layout” folder in a different library within your operating system, as described in Step 1.)

Step 4

The HPM keyboard layout should now appear in the list on the left. Make sure to check the box “Show Input menu in menu bar” (in System Preferences/Keyboard/Input Sources), where a flag or other symbol appears.

Step 5

In order to switch between input sources (i.e. keyboard layouts), you can click on the keyboard layout from the icon on the menu bar. Or, under System Preferences/Keyboard/Shortcuts/Input Sources, choose the desired keyboard shortcut to switch quickly between different input sources.

Modifying the Keyboard Layout

The keyboard layout can be modified to suit individual needs and preferences. The following steps explain how.

Step 1

Open the keyboard layout file with a text editor program such as jEdit or Brackets.

Step 2

Now search for characters already existing within the keyboard layout. You can use the “Show Keyboard Viewer” (from the menu bar), for example, to identify characters that are unnecessary and replace these with desired characters. Or you can rearrange the placement of the characters on the the keyboard. Here is an excerpt from the file:

<key code="25" output="}"></key>
<key code="26" output="\"></key>
<key code="27" output="¿"></key>
<key code="28" output="{"></key>
<key code="29" output="≠"></key>

Simply change the output character (in between quotation marks), which can be inserted directly into the file from the “Show Emoji & Symbols” window (selected from the menu bar).

Step 3

You will probably wanted to modify the name of your keyboard layout, so as not to confuse with another older/similar version. This is done within the keylayout-file with a text editor. The name of the keyboard layout is found in line 3 of the HPM-de.1.4 keylayout, which looks like this:

<keyboard group="126" id="-39" name="HPM de 1.4" maxout="1">

There, you can substitute, for example, "HPM de 1.5" (or whatever you would like to name the layout). Make sure to use only straight quotes [" "] and not typographic [curly “ ”] quotes.

Note: although you can (and should) also change the name of the file in Finder, this will not change the name of the keyboard layout in the selection of the input sources in System Preferences. The name must be changed from within the actual text of the file, by opening this with a text editor, as described above.

Step 4

Once you have saved the modified keyboard layout in the proper location and with the proper name (ending must be .keylayout), you can add it to your list of input sources (see Initial Installation above).




Contact

Charles W. Steitler
charles.steitler@adwmainz.de