Getting Started With Keyboard Development
Below is a short description of what you need to install to be able to work with
Preparations
General
sudo pip-3.5 install lxml PyICU PyYAML
If you have NOT installed the other packages (e.g. if you are only
sudo port install autoconf automake libtool pkgconfig \ imagemagick apache-ant python35 py35-pip sudo port select --set python3 python35 sudo pip-3.5 install lxml PyICU PyYAML
Also, it is a good idea to set up
Getting the source code
All keyboard code is now moved to github, and each
NB! The whole keyboard infrastructure is changing at the moment, as the keyboard
Introduction
There is an overview of the basic concepts on
Desktop keyboards
It is pretty simple:
- edit xxx.yaml
- run make
where xxx is the language code of the language you want. xxx can also be
The make command produces several output files:
-
doc/xxx_keyboards.svg - graphical overview of the layout
-
linux/hdn_keyboard.* - linux files (needs to be merged with the rest of
-
macos/xxx_keyboard.* - installation package (and source bundle) for macOS,
-
win/kbdxxxxx.klc - source file for MS Keyboard Layout
Creator.
Things to consider/change:
- in project.yaml:
- name and description at least in English and the target language
- name of icon file (any png file will do)
- list the names of all yaml files (without the .yaml extension) under the
- also change author, e-mail, copyright etc to your likings
- name and description at least in English and the target language
- in the xxx.yaml file(s):
- add display names in the relevant languages
- for languages with only an ISO-639-3 code, consider adding the nearest
- for languages with only an ISO-639-3 code, consider adding the nearest
- add display names in the relevant languages
Technical documentation
The core component/tool for building keyboards is kbdgen, a Python script
Further notes:
macOS
You can add a README file and a License file, as well as a background image for
- documents: txt,html,rtf
- images: background + .jpg,.png
Valid filenames for the documentation are: readme, welcome, license,
To make the files be used by the package builder, add a resources: key to
targets: osx: packageId: no.uit.giella.keyboards.smj version: 0.1.0 bundleName: *bundleName icon: icon.png resources: doc
The string doc in the example above is the name of a directory containing
NB! When using html as the file format, make sure you do not include
Windows
With recent changes to the keyboard generation tool kbdgen, one can actually
- install Wine - ensure that you choose the
- install Winetricks
Add the bin dir of Wine to your $PATH, and make sure that also winetricks
Next, you need to install further tools, most easily done by running the
#!/bin/sh export WINEARCH="win32" if [ -z "$WINEPREFIX" ]; then export WINEPREFIX="$HOME/.wine" fi INNO=http://www.jrsoftware.org/download.php/is-unicode.exe MSKLC=https://download.microsoft.com/download/1/1/8/118aedd2-152c-453f-bac9-5dd8fb310870/MSKLC.exe echo "Getting Inno Setup…" curl -OL "$INNO" echo "Getting MSKLC…" curl -O "$MSKLC" echo "Installing dotnet20 with winetricks…" winetricks -q dotnet20 echo "Installing MSKLC…" unzip -o `basename $MSKLC` msiexec /i MSKLC.msi /passive echo "Installing Inno Setup…" wine `basename $INNO` /SILENT echo "Done!" echo echo "You will want to put the following in your .profile or a script you source before running kbdgen:" echo echo "export WINEARCH=\"win32\"" echo "export WINEPREFIX=\"$WINEPREFIX\"" echo "export INNO_PATH=\"\$WINEPREFIX/drive_c/Program Files/Inno Setup 5\"" echo "export MSKLC_PATH=\"\$WINEPREFIX/drive_c/Program Files/Microsoft Keyboard Layout Creator 1.4\""
After having saved the script and made it executable, run it, and follow the
Finally, you need to add a real uuid for each language. Run the command:
uuidgen
and paste the generated uuid in the project.yaml file under
In some cases, especially the Sámi languages, one has to add a locale
targets: win: locale: sma-Latn-NO
Repeat for all layout files. If not added, the keyboard won't integrate properly
Making a draft layout
Desktop keyboards are relatively complex things, and to get a head start, and at
make draft XML_SRC=xx
where xx is either a two-letter language code, or the full filename +
Compatibility notes
See the note above on the use of language codes for best compatibility with
Windows
The generated keyboard (using the linked MS Keyboard Layout Creator (see above)
macOS
The keyboard package is compatible with most versions of macOS, going back all
Linux
The generated code is directly compatible with existing code, but must be merged
Mobile keyboard apps
The mobile keyboards have more dependencies, documentation is linked below. They
iOS build instructions
- follow instructions at https://github.com/divvun/kbdgen/blob/master/doc/targets/ios.md
- follow the instructions here to get your signing identity
- make ios
This is not enough, more instructions to come.
Android build instructions
- follow instructions at https://github.com/divvun/kbdgen/blob/master/doc/targets/android.md
- check out $GTPRIV
- define $GTPRIV
- define KEY_PW and STORE_PW to contain the password for the signing certificate
- make android
This is not enough, more instructions to come.
Adding a new language
- requires that one has set $GIELLA_TEMPLATES
Run the commands:
export GIELLA_TEMPLATES=/path/to/giella-templates cd $GTHOME/keyboards ./autogen.sh ./configure make NEW_LANGS=xxx
Replace xxx with the actual language code of the language you want to add.
When the new language dir is populated with Makefile's and template data, commit
When done, start editing the $NEW_LANGS.yaml file, and run make. Have a