10

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.

13
  • 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. Commented Aug 13, 2011 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? Commented Aug 13, 2011 at 2:05
  • If you post a link to your layout I can test it on my machine. Commented Aug 13, 2011 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). Commented Aug 13, 2011 at 9:43
  • FYI: I edited the case to include the link to a keylayout file I've tried. Commented Aug 13, 2011 at 10:41

8 Answers 8

2

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

2
  • 1
    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. Commented Sep 11, 2011 at 0:30
  • Anyways, using the advice from the link fixed this issue for me. Thanks again! Commented Sep 11, 2011 at 0:35
2

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?

6
  • 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) Commented Aug 13, 2011 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. Commented Aug 13, 2011 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? Commented Aug 13, 2011 at 14:41
  • No, I'm not seeing it in Input Sources at all. Commented Aug 13, 2011 at 15:04
  • BTW, this layout is made for an aluminium wireless keyboard. Commented Aug 13, 2011 at 15:13
2

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
10
  • 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? Commented Aug 13, 2011 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. Commented Aug 13, 2011 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. Commented Aug 14, 2011 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). Commented Aug 14, 2011 at 14:02
  • I also tried with normal USB+keyboard, with the wireless keyboard shut down, and it didn't help. Commented Aug 14, 2011 at 20:55
2

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?

1
  • I did use Console, but I have not searched for that particular error. I'll look into at today. Commented Aug 16, 2011 at 13:50
2

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 {} \;
1

If you can't switch to a custom keyboard layout that works fine on a different computer, it may be related to the quarantine attributes applied to the files copied to the new system.

To check if that's the case:

$ find ~/Library/Keyboard\ Layoutse -type f -exec xattr -l {} \;
com.apple.quarantine: 0082;61e7e8e7;Screen\x20Sharing;
com.apple.quarantine: 0082;61e7e8e7;Screen\x20Sharing;
com.apple.quarantine: 0082;61e7e8e7;Screen\x20Sharing;
com.apple.quarantine: 0082;61e7e8e7;Screen\x20Sharing;
com.apple.quarantine: 0082;61e7e8e7;Screen\x20Sharing;

To remove them:

$ find . -type f -exec xattr -d com.apple.quarantine {} \;
1
  • In macOS 12.2 (Montery) this worked for me. As soon as I removed the quarantine attribute, I was able to select the layout and it stayed working. Commented Feb 7, 2022 at 12:19
-1

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

-1

Use older stable Ukelele version 1.8.4. Not even restart is necessary.

I have Mac 10.10.5 (Yosemite). Ukelele current version did not work even after I tried all possible suggestions from various forums. Finally I uninstalled current version of Ukelele and installed older stable version 1.8.4. Things worked like magic. No restart is necessary. You just save the new layout within Library/Keyboard Layouts. Then open keyboard preferences input sources. Add by clicking +. You should see the new layout in "Others".

1
  • Hi - thanks for your answer. It would be helpful if you edited it so that it is not all in caps - some think this is analogous to shouting. This would also make your post easier to read.
    – Scot
    Commented Aug 27, 2015 at 0:07

You must log in to answer this question.

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