5

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?

2
  • 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, 2012 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 :) Mar 21, 2012 at 13:32

4 Answers 4

5
+50

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.

1
  • 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! Mar 21, 2012 at 13:31
2

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.

1
  • 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, 2013 at 19:43
1

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.

1
1

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .