Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

In Lion you can hold down a key to show its variations.

Screenshot

However, when using my custom keyboard layout in .keylayout format, this functionality is disabled.

I assume Lion’s default keyboard layouts have the special characters that appear when you hold down a certain key hardcoded somewhere, and my old custom keyboard layout (based on the default Snow Leopard-layouts) lacks that data.

My question is: how can these “key variations” be defined in a .keylayout file?

share|improve this question
    
Apple's default Keyboard Layout's live in "\System\Library\Keyboard Layouts" however they are stored as a bundle with an unknown format internally. –  Stu Wilson Mar 21 '12 at 13:17
    
@StuWilson Yeah, that’s the problem. Else we could just open one of the default files and see how things are done :) –  Mathias Bynens Mar 21 '12 at 13:32

4 Answers 4

The special characters included in the popovers are defined in files like /System/Library/Input Methods/PressAndHold.app/Contents/Resources/Keyboard-en_US.plist, not in .keylayout files. (The popovers are also used with languages that have their own input methods like Vietnamese.)

I don't know how to add a property list like that for a custom layout though. I also tried copying the U.S..keylayout that comes with Ukelele to ~/Libary/Keyboard Layouts/ (without changing the name or id), but the popovers didn't work with it.

share|improve this answer
    
The problem is that none of the default keyboard layouts come in .keylayout format — so there’s no way of knowing if it is even possible to define these special characters in that format. Good find on the .plist files! –  Mathias Bynens Mar 21 '12 at 13:31

As far as I know the .keylayout file is not involved with this feature, it is somewhere else in the system.

Many people have also asked how the character picker can be customized, but to date nobody has figured out how to do that either.

share|improve this answer
    
Looks like @Lri has: apple.stackexchange.com/a/44927/4408 :) Sadly, this still doesn’t answer my question. –  Mathias Bynens Mar 28 '12 at 13:30
up vote 1 down vote accepted

Ukelele.app 2.2 now supports this, kind of:

By saving a keyboard layout in a bundle, it will become compatible with the “press and hold” mechanism for entering diacritics, introduced in OS X 10.7 (Lion). For this purpose, an “intended language” can be supplied (default is the system language), which will determine which possibilities are offered in the pop-up. However, such bundles may not work with OS X 10.4 (Tiger) and earlier.

share|improve this answer
1  
I used this and it works, my own keyboard layout (mixed between US International, snd set with alt for programming and the unicode layout) and saved it as a bundle. Mostly with ukelele. Unicode implementation on caps lock isn't something ukelele can do. –  user8551 Jan 14 '13 at 19:43

The new version of English/Russian Typographical keyboard layout by Ilya Birman (v. 3.0) supports Press and Hold for entering key variations even though it’s a custom keyboard. I’ve managed to replace his layout from the bundle with mine, but these functionality worked only if layout name set in Ukelele was kept the same.

Now I have my own custom layout with my own icon and Press and Hold support, but it’s name is “English — Ilya Birman Typography” and yet I can’t do anything about it. Can anybody think of an workaround for these?

You can download Birman’s layout from here (install script) — http://ilyabirman.ru/projects/typography-layout/ (click on “Скачать раскладку для Мака”) or here — http://cl.ly/HrDP though I’m not sure the second option will have Press and Hold support without running install script first.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.