This is an archive of the original scripts.sil.org site, preserved as a historical reference. Some of the content is outdated. Please consult our other sites for more current information: software.sil.org, ScriptSource, FDBP, and silfontdev



Home

Contact Us

General

Initiative B@bel

WSI Guidelines

Encoding

Principles

Unicode

Training

Tutorials

PUA

Conversion

Resources

Utilities

TECkit

Maps

Resources

Input

Principles

Utilities

Tutorials

Resources

Type Design

Principles

Design Tools

Formats

Resources

Font Downloads

Gentium

Doulos

IPA

Rendering

Principles

Technologies

OpenType

Graphite

Resources

Font FAQ

Links

Glossary


Computers & Writing Systems

SIL HOME | SIL SOFTWARE | SUPPORT | DONATE | PRIVACY POLICY

You are here: Input > Utilities
Short URL: https://scripts.sil.org/keylayoutmaker

KeyLayoutMaker:

Perl script to create Mac OS X keyboard layouts

Jonathan Kew, 2006-06-01

Introduction

The Perl script KeyLayoutMaker.pl is intended to provide a quick way to create at least a first draft of an XML keyboard layout file (.keylayout) for Mac OS X version 10.2 or later. Further adjustment, either using an editor such as Ukelele or by hand-editing the resulting XML file, may often be helpful.

This script is not a general-purpose tool for creating all types of keyboard layouts; it is designed specifically for situations where many multi-key sequences are required to generate single Unicode characters. This is one way in which syllabic scripts can be keyboarded: the keystrokes can be based on a simple romanization, such as that used in the Unicode character name. The keyboard layout created by this script will use dead key states (multiple levels, if necessary) to implement such layouts.

Updated: June 1, 2006

Release 4 of the KeyLayoutMaker.pl script includes minor bug-fixes, and allows keystroke files to include comments: any indented lines will be ignored, and '#' may be used to introduce comments after the Unicode output on any line.

Usage

KeyLayoutMaker is a Perl script intended to be run from the Mac OS X command line (i.e., within a Terminal window or similar shell):

perl KeyLayoutMaker.pl -i layoutID -n layoutName -k keystrokeFile

All three parameters are required; if any are missing, the script will simply print a usage message and terminate.

  • layoutID is a "unique ID" for the layout. For Unicode layouts (as created by this script), this must be a negative number.
  • layoutName is the name that will appear in the Input menu.
  • keystrokeFile contains a list of key sequence<tab>Unicode character (in hex), specifying the character to be generated by each supported key sequence; see example files.

The XML keylayout definition is written to standard output (so it is normal to use redirection to send it to a file).

Thus, a typical command line might be:

perl KeyLayoutMaker.pl -i -200 -n "Cree Syllabics" -k Cree.keystrokes > Cree.keylayout

where the Cree.keystrokes file begins:

a    140a
aa   140b
aai  1402
ai   141c
an   142e
c    14a1
ca   1490

The resulting .keylayout file can be installed in Library/Keyboard Layouts or a personal ~/Library/Keyboard Layouts folder. It is necessary to log out of OS X and log in again before it will be available; then use System Preferences / International / Input Menu to add the new layout to the Input menu list.

Download

KeyLayoutMaker script for Mac OS X 10.2 and later (release 4)
Jonathan Kew, 2006-06-01
Download "KeyLayoutMaker-20060601.zip", ZIP archive, 26KB [11122 downloads]

The KeyLayoutMaker distribution includes several example "keystroke files" based either on Unicode character names or on key sequences used in older legacy systems for particular languages.

For other resources related to Mac OS X keyboard layouts (tools, documentation, and available layouts), see the Input Resources page.

The KeyLayoutMaker.pl script and associated sample files and documentation are written by Jonathan Kew and copyright ©2004-2006 SIL International. They are made available with no warranty or support under  SIL's standard freeware license.


© 2003-2024 SIL International, all rights reserved, unless otherwise noted elsewhere on this page.
Provided by SIL's Writing Systems Technology team (formerly known as NRSI). Read our Privacy Policy. Contact us here.