Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Easily remap and create customized keyboard layouts System
After buying one of these sweet Apple Bluetooth keyboards with a German layout, I noticed that the key between the Zero and Enter key on the numeric keypad read as a point but acted like a coma. So I wanted to fix that. OS X 10.2 and newer (including 10.4) allow you to create a custom layout for any key on your keyboard, no matter what layout or language it is, by writing an XML file and then storing it in one of the Library/Keyboard Layouts folders.

Working in raw XML, though, is error-prone and tedious. To ease this process there is a freeware tool called Ukelele. Be sure to read the enclosed PDF for info on using the program.

To create an icon (with Devtools Icon Composer, for instance) for the Language Tool Bar, simply place a *.icns file with the same name as the Layout into the appropriate Keyboard Layouts folder. For example, German Numpad Point.keylayout and German Numpad Point.icns.

If anyone knows how to pack such a layout into a bundle or package, please tell how...
    •    
  • Currently 3.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (2 votes cast)
 
[25,300 views]  

Easily remap and create customized keyboard layouts | 17 comments | Create New Account
Click here to return to the 'Easily remap and create customized keyboard layouts' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Easily remap and create customized keyboard layouts
Authored by: qubex on Jun 30, '05 10:50:36AM

Both the words 'coma' and 'comma' denote a pause, but the former is frequently longer than the latter.



[ Reply to This | # ]
Easily remap and create customized keyboard layouts
Authored by: heavyphotons on Jun 30, '05 11:05:10AM

Said as someone who has never been trapped in a comma. :P



[ Reply to This | # ]
Easily remap and create customized keyboard layouts
Authored by: osxpounder on Jun 30, '05 01:41:21PM

I think I read that somewhere before -- the Coma Sutra?

---
--
osxpounder



[ Reply to This | # ]
Easily remap and create customized keyboard layouts
Authored by: b00le on Jun 30, '05 11:08:34AM

I've done the same thing with an Italian Pro keyboard - also changing the square brackets for Photoshop. Ukelele (why not give it a name that one might remember the next time one wants to use it?) works OK, although it seemed to produce a lot of incomprehensible error messages before going on working as it seemed it should. One curiosity - the new keyboard does not work with shortcuts in Illustrator, and sometimes it just goes away on its own.



[ Reply to This | # ]
Easily remap and create customized keyboard layouts
Authored by: zimmerleut on Jun 30, '05 12:30:48PM

Have you made sure that the keymaps for the cmd and/or other modifier keys contain the newly set keys? E.g. when you switch 'y' and 'z' on a German keyboard, you have to switch them on all the modifiers as well to get the expected behaivior for cmd+z or cmd+option+z.

Concerning your second problem: Did you try changing the "Use the same source for all documents" in the Internatioal->Keyboard Menu pref. pane?



[ Reply to This | # ]
Easily remap and create customized keyboard layouts
Authored by: Arturia on Jun 30, '05 12:58:27PM
Keyboard Builder

CLICK ME

:-)

[ Reply to This | # ]
Easily remap and create customized keyboard layouts
Authored by: thoughton on Jun 30, '05 03:24:30PM

That webpage is pretty non-descriptive :)

What does the app do? It looks like an app for colouring in keyboards on screen. I hope that isn't actually the case...



[ Reply to This | # ]
Easily remap and create customized keyboard layouts
Authored by: Arturia on Jun 30, '05 11:31:24PM
Indeed, it's not really descriptive ;-)

The prog is specifically made for remapping a keyboard.

Here's what's said in the read me's:

Guide on Creating .keylayout Files Using Keyboard Builder

Keyboard Builder displays a keyboard using a number of text fields. Each text field is in
place of a key which would mean editing the text in that field would change the output of
that key when pressed. To add characters that can't be typed requires the need to drag
and drop them on the key. There is a table that shows every character; and it is available
by clicking on the 'Edit' menu and selecting 'Special Characters...'. This is automatically
built into most text editing applications. From there, just simply drag and drop the
character onto the keyboard where it should go.

To add characters that can't be typed like the delete, return, escape, and others just
simply type the name of it in the text field. For example, type in 'return' for the return
key. After clicking in another text field it should update that last field's text color to
a blue color signifying that it is now has a 'return' value in it.

A keyMap is what a keyboard uses when say for example a user holds down a modifier like
the shift key. Different characters are outputted when holding down the shift key and
these characters can be assigned much the same way as described above. First look at the
bottom of a Keyboard Builder document and there will be a box titled: 'keyMap' this box
has a popup menu and two buttons titled 'new' and 'delete'. The popup menu displays the
current keyMap that is being displayed in the keyboard text fields. Clicking on new will
create a new keyMap and will change all those text fields to be blank. Now, adding
characters to the above text fields will only be accessed by this new keyMap. Switch back
and forth between keyMaps using the keyMap popup button.

To assign a modifier, like the shift key modifier, to a keyMap just select the keyMap in
the keyMaps popup menu and then click on the check box that just so happens to be in the
shift key location. These check boxes can have 3 different states: unchecked, dashed, and
checked. Putting a check in one means that this key must be down in order to access the
current displayed keyMap. Unchecked would then mean that the key must not be pressed down
. A horizontal line in the check box means the key can be either down or up.

These modifiers are also displayed in a popup menu in the box titled 'modifier keys for
current keyMap'. To make things even more complicated... there can be multiple modifier
groups all assigned to one keyMap. These are all displayed in that popup menu. Selecting
one of the items in that popup will change the modifier check boxes.

Guide on Installing Keyboards in Mac OS X

Locate the .keylayout file and move it to '~/Library/Keyboard Layouts' folder to make it
usable only by the current user. Or, move it to the system's folder which is located at:
'/Library/Keyboard Layouts'. If the folder 'Keyboard Layouts' is not there then just
create one with the name 'Keyboard Layouts'.

Now, when the .keylayout file is in the Keyboard Layouts folder just logout completely and
back in to activate the keyboard. Next, open up System Preferences and click on 'International'.
Click on 'Input Menu' and there will be a list of all the keyboard layouts. Scroll down until
the keyboard that was recently put in the folder is displayed and click the checkbox next to it.
This will add it to the list in the menu bar which has a little flag. Click on the menu and select
the keyboard.

[ Reply to This | # ]

Easily remap and create customized keyboard layouts
Authored by: jagboy on Jun 30, '05 01:11:17PM

Well, go figure... I'm no native speaker, anywayz...

I figured out how to create a bundle.

Here's how to do it:

Create an empty bundle and give it a name, e.g.: Weird Layout
Create a Folder inside it named "Contents"
Inside it create an Info.plist with the following values:
CFBundleDevelopmentRegion String English
CFBundleIdentifier String com.apple.keyboardlayout.roman
CFBundleInfoDictionaryVersion String 6.0
CFBundleName String LCCKCHR
CFBundleVersion String 1.0
CSResourcesFileMapped Boolean Yes

save the Info.plist
Now create a folder named "Resources" where you will put the "weird.keylayout" (and optional an icon file "weird.icns")

Inside the Resources folder create a folder named "English.lproj"
Create a file named "InfoPlist.strings"
inside it put a text like:
/* Keyboard layout names */
"weird" = "Weird Layout";

Now duplicate the whole "English.lproj" and rename it to the language you are using OSX in, in my case "German.lproj" and there you'll modify the plist to read something like:
/* Keyboard layout names */
"weird" = "Komisches Layout";

If anyone got a 100KB of webspace to host a sample bundle contact me.

Oh, and if you think the tutorial here was too long and too hard then read this:
http://developer.apple.com/technotes/tn2002/tn2056.html

Ciao and good luck!



[ Reply to This | # ]
Easily remap and create customized keyboard layouts
Authored by: thoughton on Jun 30, '05 03:26:52PM

Is it possible to remap modifier keys with this method? Specifically the 'enter' key on a PB.

(Still waiting for DoubleCommand to be updated for Tiger, feels like PB is broken without it)



[ Reply to This | # ]
Easily remap and create customized keyboard layouts
Authored by: trekvogel on Jun 30, '05 03:40:17PM

I would like to remap my iBook's enter key so it opens stuff in the Finder. Anyone knows how to do this?



[ Reply to This | # ]
Easily remap and create customized keyboard layouts
Authored by: jagboy on Jun 30, '05 08:14:53PM

You can hit Apple + O to open files in the finder.
Remapping the Enter or Return key would result in your Keyboard being unable to be used in all other programs that require it (e.g. Word, TextEdit, XCode, ...)

What you can however do I think is: Go to Systemprefs -> Keyboard & Mouse and then Keyboard-Shortcuts, Click the + and then assign a key for application Finder to open a file (e.g. the Clearscreen button above the 7 on the numpad)

good luck



[ Reply to This | # ]
Easily remap and create customized keyboard layouts
Authored by: rogera on Jul 01, '05 08:45:32PM

to jagboy:

Can you tell me of a use of the "enter" key in
TextEdit that cannot already by handled by
the "return" key? I am very curious about
this because I want to use the "enter" key
as follows in a text editor:


Put the ibeam somewhere in the text.
Make no selection.
Press the "enter" key, nothing else.
A piece of AppleScript goes into action.


I posted on this topic at:

http://discussions.info.apple.com/webx?128@826.NmJDaC0YV3g.3@.68b11cf2

If you or anyone else reading this topic has
any advice on how to get the "enter" key
to work this way in a text editor, please
post here.

Thank you,

Roger Purves



[ Reply to This | # ]
Easily remap and create customized keyboard layouts
Authored by: b00le on Jul 01, '05 12:38:18PM

The first was not a problem. What I don't understand is the message when you open a layout "This layout is not available on the current system (no KCAP resource with ID 35). Using default keyboard layout" - I go OK then switch to the USB Pro layout which is not, in fact, identical - mine has a big Return key and the ù is down one row, but it seems to work.

That single source hint is exactly what I needed. Grazie mille!

(Now if someone here could find me a fix for the SMB bug I'd be happy again...)



[ Reply to This | # ]
Easily remap and create customized keyboard layouts
Authored by: jdos2 on Jul 08, '05 10:06:42AM

I've been experimenting with several remapping utilities, but I'm still left with the problem that I originally tried to fix:

I've an IBM "Selectronic" type keyboard that's been with me since the early OS/2 (PS/2!) days. It's got great feedback, and works well with a USB-PS/2 adapter. I'd like to be able to use it on the Mac, but of course, it doesn't have the pretzel ("Option") meta-key.
Is there a fairly simple way of mapping the RIGHT control or alt key to act as the "option" key? I can't seem to get the modifier keys remapped, and is my current stumbling point.
Otherwise, I have to have two keyboards attached to my Mac, and that's a bit... Cumbersome.

JD

---
2001 Moto Guzzi V-11 Sport
1999 Triumph Trophy (Shop Bike) 1200



[ Reply to This | # ]
Easily remap and create customized keyboard layouts
Authored by: KenaiTheMacFan on Jul 12, '05 08:03:46PM

Where did you get an adapter that enables you to plug a PS/2 cable in a usb port?????????

Also, what does PS/2 mean??

---
Ian



[ Reply to This | # ]
Easily remap and create customized keyboard layouts
Authored by: volkscomputer on Jul 30, '05 07:59:26PM

I don't know if i'm the last one to use an original Apple Extended Keyboard II (german). I use and love it since my first "big" mac in 1995. Today, it's connected to one of my 3 Macs (PB, G4, Mac mini) with Griffin's iMate USB to ADB adapter.
Unfortunately since 10.4.x I lack some keys, notably:
* the < key between [left shift] and [y]
* the ° upper left key on top of the [tab] key
Trying various settings with "Keyboard" control panel's "Keyboard Assistant" didn't help. Building a custom layout is a big annoyance at least for the PB, because that would change the built-in keyboard's layout too.

Some hint anyone?



[ Reply to This | # ]