/install-keyboard-layout

Custom keyboard layout based on Logitech Swiss German

Keyboard Layout

macOS Windows

Custom keyboard layout based on the Logitech Swiss German keyboard layout.

Installation

macOS

macOS

  1. Download CustomSwissGerman.keylayout and CustomSwissGerman.icns
  2. Copy both files to /Library/Keyboard Layouts:
    sudo cp CustomSwissGerman.* /Library/Keyboard\ Layouts
  3. Log out of macOS and log in again
  4. Go to System Preferences > Keyboard > Text Input > Edit... > [+] > Others
  5. Locate the Custom Swiss German keyboard layout in the list and add it

Windows

Windows

Tested on Windows 10.

To install the keyboard layout, you must build a setup package from the CustomSw.klc file and then install this package:

  1. Download and install the Microsoft Keyboard Layout Creator (MSKLC)
  2. Download the CustomSw.klc file
  3. In MSKLC, go to File > Load Source File... and select the CustomSw.klc file
  4. Click on Project > Build DLL and Setup Package

    This creates a directory called customsw in the current working directory. There may be a dialog notifying about warnings during the build which can be ignored.

  5. Run setup.exe in the customsw directory

    This installs the keyboard layout as CustomSw.dll to C:\Windows\System32 and creates the necessary registry entries to make the layout available to the system. If setup.exe doesn't work for some reason, try executing CustomSw_amd64.msi.

  6. In Windows, go to Settings > Time & Language > Language > Keyboard > Override for default input method and activate the Custom Swiss German keyboard layout

Important: after the installation, keep the customsw directory somewhere on the system. This is because the contained setup.exe file allows to cleanly uninstall the keyboard layout. Uninstallation is necessary if you want to make changes to the keyboard layout (i.e. by editing the .klc file and rebuilding the DLL and setup package as described above) and then reapply it. The reason that the keyboard layout must be uninstalled before making changes is that MSKLC refuses to export a keyboard layout with the same name as an already installed keyboard layout.

Notes

Mappings

The keyboard layout is based on the Logitech Swiss German layout. The differences to the Logitech Swiss German layout, and also the native macOS Swiss German layout, are listed below:

Character Custom Logitech Swiss German macOS Swiss German
` ` Opt-1 Opt-1
(en dash) Opt-[-] Opt-[-] Opt-[-]
(em dash) Ctrl-Opt-[-]
ā, ē, ī, ō, ū Opt-[AEIOU]
Ā, Ē, Ī, Ō, Ū Opt-Shift-[AEIOU]
Opt-R Opt-E Opt-E

As can be seen, the custom keyboard layout, among others, adds key mappings for vowels with macrons (e.g ā) as they are used, for example, in Japanese romanisation systems.

File origins

LogitechSwissGerman.keylayout

Obtained from Ukelele by opening its DMG file and navigating to Resources/Standard Keyboards. The Logitech Swiss German keyboard layout is located in the Logitech Keyboard Layouts.bundle file.

CustomSwissGerman.keylayout

Created with Ukelele by using the LogitechSwissGerman.keylayout as a base.

CustomSw.klc

Generated from LogitechSwissGerman.keylayout as explained in Windows keyboard layout file generation below.

Windows keyboard layout file generation

The following explains how to generate the CustomSw.klc file from CustomSwissGerman.keylayout:

  1. Clone adobe-type-tools/keyboard-layouts:
    git clone https://github.com/adobe-type-tools/keyboard-layouts
  2. Execute the following command:
    python3 mac2winKeyboard.py CustomSwissGerman.keylayout
  3. Do the following manual fixes in the created CustomSw.klc file:
    1. Change the line:
      29  OEM_3		SGCap	003c	003e	-1	-1	005c	2030	// LESS-THAN SIGN, GREATER-THAN SIGN, <none>, <none>, REVERSE SOLIDUS, PER MILLE SIGN
      to:
      29  OEM_3		SGCap	00a7	00b0	-1	-1	2264	2265	// SECTION SIGN, DEGREE SIGN, <none>, <none>, LESS-THAN OR EQUAL TO, GREATER-THAN OR EQUAL TO
    2. Change the line:
      56  OEM_102		0	00a7	00b0	-1	-1	2264	2265	// SECTION SIGN, DEGREE SIGN, <none>, <none>, LESS-THAN OR EQUAL TO, GREATER-THAN OR EQUAL TO
      to:
      56  OEM_102		0	003c	003e	-1	-1	005c	2030	// LESS-THAN SIGN, GREATER-THAN SIGN, <none>, <none>, REVERSE SOLIDUS, PER MILLE SIGN
    The above fixes are necessary because the OEM_3 key (§ ///°) and OEM_102 key (<///>) seem to be swapped on macOS keyboards with respect to Windows keyboards. is

Note: keyboard layout file names on Windows can have at most 8 characters (excluding the extension). That's why the name of the output file is shortened to CustomSw.klc.