You might have a look at Ukelele, a free Mac OS X Keyboard Layout Editor :
Ukelele is a Unicode Keyboard Layout
Editor for Mac OS X versions 10.2 and
later. Version 2.0 and later are only
for Mac OS X versions 10.4 and later.
Beginning with version 10.2 (Jaguar),
Mac OS X supports an XML-based format
for keyboard layouts (.keylayout
files). These may be installed by
copying them to the Keyboard Layouts
folder within /Library or ~/Library;
then they are enabled via the Input
tab of the International (Language &
Text in 10.6) module within System
Preferences.
However, modifying keyboard
layouts—let alone creating entirely
new keyboard layouts, such as for a
new script—by directly editing the XML
text is tedious and error-prone.
Ukelele aims to simplify keyboard
layout editing by providing a
graphical interface to .keylayout
files, where the desired characters
can simply be dragged onto keys as
needed. (The Character Palette or
Character Viewer, available in the
Input menu if it has been enabled in
System Preferences, is a great place
to find the characters.)
In addition to simple assignment of
single character codes to keys,
Ukelele can assign multiple-character
strings and can create "dead keys",
where a keystroke sets a new state
that modifies the output of the
following keystroke.
For more information about Mac OS X
keyboard layouts, as well as existing
layouts available for download, see
Input Resources. For some types
of layout, particularly with large
numbers of dead-key sequences,
creating a layout with the text-based
tool KeyLayoutMaker may be a
useful alternative.