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.

I created a custom keyboard layout with Ukelele (http://scripts.sil.org/ukelele) in Snow Leopard (idea is to generate scandinavian letters with Alt-key, otherwise have a pretty much standard U.S. layout). After the upgrade, the old installed (to ~/Library/Keyboard Layouts) layout wasn't working.

Ukelele seems to work OK in Lion, but whether I put the generated keylayout in a bundle or single file, or save it "/Library/Keyboard Layouts" or "~/Library/Keyboard Layouts" doesn't seem to matter.

Help?

EDIT:

@Sergio, I cannot choose the layout in Input Sources. One keylayout file I tried: http://semeai.org/~sjl/us-scands.keylayout

BTW Off-topic: I don't know if I'm going blind or something, but I can't seem to locate the Library directory in Finder. I need to copy stuff to and fro from my home directory.

UPDATE:

I've been trying to get this work on my machine for a few hours now and I just thought to try out with a random layout from the 'net; http://colemak.com/Mac was the first to hit the radar. I did the same thing as with my layout, saved it under Library, and it shows under Input Sources. My layout still doesn't. I'll try to create a layout from scratch, see if that helps. BTW, apparently "New from current input source" in Ukelele is broken in Lion.

UPDATE 2011/08/15:

@Tom:

Copied your keylayout (it naturally ended up in my Junk folder):

midgard (01:55) >ls -l ~/Library/Keyboard\ Layouts/MongolianQWERTY.keylayout
-rw-r--r--@ 1 sjl  staff  44536 Mar 13  2008 /Users/sjl/Library/Keyboard Layouts/MongolianQWERTY.keylayout

Logged out, logged in, isn't showing in Input sources (I'm looking very closely between "Maori" and "Myanmar - QWERTY").

I've also uninstalled bunch of software and plugins giving suspicious messages to system.log, but hasn't helped.

UPDATE 2011/08/16:

I created a test account, and lo, the layout works perfectly for it. Also the bug in preferences doesn't show for that account. When trying this on my own account, there are no errors in Console logs with the suggested keywords (I can't seem to locate console.log file, though).

UPDATE 2011/08/16 later:

Nuking Library/Caches (and relogging) didn't help.

UPDATE 2011/08/17:

I did

% find Library -name "*.plist" -exec mv {} {}.renamed \;

and restarted, but it didn't help. I restored the situation with

% for file in `find Library -name "*.plist.renamed"`; \
  do mv "$file" "${file//.renamed/}"; done

addendum: I also went through all the .plist files with plutil -s as described in http://www.askdavetaylor.com/can_i_check_my_plist_files_in_mac_os_x_for_problems.html. There was some brokennes, but in very unrelated applications.

UPDATE 2011/09/10:

I went the extra mile and moved my whole Library away using another account, login in with my own account and observing stuff still not working. I have copied the layout to /Library/Keyboard Layouts, from where it works for a test account, but not for my own. Also, if I delete all the custom keylayout files, from everywhere, the Character Viewer and the Keyboard Viewer appaer as selectable to the Input Sources menu and also show under the International menu in the menubar. As soon as I copy a keyboard layout to Library (home or system), the viewers disappear from both the menu and the Input Sources.

Any ideas how I could get more information from the system? I tried Command-V on boot for verbose boot but that didn't give any extra information for this issue.

SOLUTION FOR POSTERITY:

Adapted from http://support.apple.com/kb/TS1896?viewlocale=en_US for Lion:

sudo rm /System/Library/Caches/com.apple.IntlDataCache*
sudo find /var/ -name "*IntlDataCache*" -exec rm {} \;

Restart.

share|improve this question
    
I'm typing this using an Ukelele made layout in Lion, but the layout was made on Snow Leopard. So it probably not something specific to custom layouts, but maybe your specific customizations. –  Sergio Acosta Aug 13 '11 at 2:04
    
Can you select the new layout using the Input menu but the keys don't type the correct characters? Or the layout simply does show as installed? –  Sergio Acosta Aug 13 '11 at 2:05
    
If you post a link to your layout I can test it on my machine. –  Sergio Acosta Aug 13 '11 at 2:06
    
I think the standard US layout already generates the characters needed for scandinavian languages via the alt key without modification. I'm also willing to test your layout if you send it (tom at bluesky dot org). –  Tom Gewecke Aug 13 '11 at 9:43
    
FYI: I edited the case to include the link to a keylayout file I've tried. –  Sami Lehtinen Aug 13 '11 at 10:41

6 Answers 6

up vote 1 down vote accepted

Try this fix which Apple published when the keyboard viewer and character viewer used to disappear in 10.5:

http://support.apple.com/kb/TS1896?viewlocale=en_US

share|improve this answer
    
Instead of sudo rm /var/folders/*/*/-Caches-/com.apple.IntlDataCache* I'd use sudo find /var/ -name "*IntlDataCache*" -exec rm {} \;, as the old glob pattern didn't match anything. I used a lot more broad pattern, but it matched only what I've linked here matches. –  Sami Lehtinen Sep 11 '11 at 0:30
    
Anyways, using the advice from the link fixed this issue for me. Thanks again! –  Sami Lehtinen Sep 11 '11 at 0:35

The layout you gave the link to works fine for me. Are you sure that your copy of the file ends only in .keylayout and not .keylayout.xml or something else? You have done logout/login after installing it, right?

share|improve this answer
    
I use the cp command to copy it to place. I see the file in place with ls. I'll try with only that keylayout file and rebooting the machine, there is some crud in Layouts directory after my experiments. (I have relogged and rebooted sevelar times while trying to solve this) –  Sami Lehtinen Aug 13 '11 at 13:36
    
Removed all other keylayout files from under ~/Library and Library. ls output: midgard (16:59) >ls -l ~/Library/Keyboard\ Layouts total 96 -rw-r--r-- 1 sjl staff 48265 Aug 13 16:47 us-scands.keylayout . Rebooted and the layout still doesn't show under Input Sources. –  Sami Lehtinen Aug 13 '11 at 14:00
    
I also dropped your layout in my library folder (~/Library/Keyboard\ Layouts) and it shows under Input sources as "U.S. with scands //sjl", but I am not able to type: I press the keys and nothing happens. Is this the same problem you are having? –  Sergio Acosta Aug 13 '11 at 14:41
    
No, I'm not seeing it in Input Sources at all. –  Sami Lehtinen Aug 13 '11 at 15:04
    
BTW, this layout is made for an aluminium wireless keyboard. –  Sami Lehtinen Aug 13 '11 at 15:13

Your layout worked for me after:

  1. Downloaded the file you provided. ( is my bash prompt)

    ~/Downloads  
    ⌘  wget http://semeai.org/~sjl/us-scands.keylayout
    --2011-08-13 23:44:27--  http://semeai.org/~sjl/us-scands.keylayout
    Resolving semeai.org... 217.30.177.5
    Connecting to semeai.org|217.30.177.5|:80... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: 48265 (47K) [text/plain]
    Saving to: `us-scands.keylayout'
    
    100%[======================================>] 48,265      32.1K/s   in 1.5s    
    
    2011-08-13 23:44:29 (32.1 KB/s) - `us-scands.keylayout' saved [48265/48265]
    
    ~/Downloads  
    ⌘  ls
    us-scands.keylayout
    
    ~/Downloads  
    ⌘  md5 us-scands.keylayout 
    MD5 (us-scands.keylayout) = 9197c43c426151cd03f524a766107b49
    
  2. Dropping it in the ~/Library/Keyboard Layouts folder

    ~/Downloads  
    ⌘  mv us-scands.keylayout ~/Library/Keyboard\ Layouts/
    

    At this point, it was already listed in Input sources:

  3. Selecting it in the input sources list on the 'Input Sources' tab on the 'Language & Text preference pane' in System Preferences

Listed layouts

  1. Loggin out and logging in again.
  2. Selecting it as the current layout on the input menu.

Are you sure you are not missing any of those steps?

My specs:

  • 15" MacBook Pro, early 2011 (thunderbolt).
  • Mac OS X 10.7 upgraded from Snow Leopard (clean Snow Leopard installation before upgrading to Lion).
  • Spanish International built-in Keyboard. I have never used an external keyboard on this Mac.

According to System Profiler:

        Apple Internal Keyboard / Trackpad:

          Product ID: 0x0246
          Vendor ID: 0x05ac  (Apple Inc.)
          Version: 1.08
          Speed: Up to 12 Mb/sec
          Manufacturer: Apple Inc.
          Location ID: 0xfa120000 / 5
share|improve this answer
    
ls output: midgard (21:23) >ls -l ~/Library/Keyboard\ Layouts total 96 -rw-r--r-- 1 sjl staff 48265 Aug 13 13:33 us-scands.keylayout , rebooted, doesn't show in the Input Sources list. I assume you see it with the other U.S. keyboard variants? –  Sami Lehtinen Aug 13 '11 at 18:26
    
I even wget the file from the web page to make sure it is the same version you guys are using. I've verified the path by cut'n'pasting from your comments. –  Sami Lehtinen Aug 13 '11 at 18:28
    
I'd +1 your answer, but don't have the rep yet :) Anyways, I've done exactly as you describe and it never shows in my Input Sources. Not before relogin or restart, nor after. –  Sami Lehtinen Aug 14 '11 at 12:16
    
what type is your keyboard? Other things don't seem to work, for example, I can't seem to get the "Show Keyboard & Character Viewers in menu bar" setting to stick (under System Preferences -> Keyboard). –  Sami Lehtinen Aug 14 '11 at 14:02
    
I also tried with normal USB+keyboard, with the wireless keyboard shut down, and it didn't help. –  Sami Lehtinen Aug 14 '11 at 20:55

According to Apple's Technical Note TN2056:

After installation, an XML keyboard will become available in the Input Menu pane of International Preferences if no errors were encountered in compiling it. If there is an error in the file, an error message will be written to console.log, prefixed by "uchr XML compiler." If the error is an XML syntax error, the line in the file where the error occurred is given. Usually, only the first error encountered is diagnosed, and parsing is aborted.

Have you tried opening Console (in Applications/Utilities) and see if there is message containing 'uchr XML compiler' after installing the keyboard layout or after logging in?

share|improve this answer
    
I did use Console, but I have not searched for that particular error. I'll look into at today. –  Sami Lehtinen Aug 16 '11 at 13:50

My problem was that my new custom keyboard layout would work in many apps - Spotlight, Sublime Text, the Terminal etc. - but not in many built-in apps such as TextEdit or Mail. The final point in the original question finally solved this issue for me:

sudo rm /System/Library/Caches/com.apple.IntlDataCache*
sudo find /var/ -name "*IntlDataCache*" -exec rm {} \;
share|improve this answer

I love ukelele. in lion last macbook pro, did not work as usual. the extension .keylayout seems not to work. it worked finally with the bundle, which you get in ukelele by saving bundle. it then has to be copied in the library/keyboardlayout with option key, otherwise it will be an alias. hope this helps

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.