Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I would like to be able to insert a Unicode character, namely š, by pressing a keyboard shortcut in OSX. Some applications allow me to press and hold the s key and then I can select the desired accented form. However, some applications, such as iTerm2 or LibreOffice don't seem to respect this.

My daughter's name is Eliška and I'd like to be able to type her name from anywhere.

The trick from here doesn't work for me. I even tried adding a Unicode string.

I also tried cloning KeyRemap4MacBook to try and add the X11 key code to the list of available codes for mapping. This compiled fine and the private.xml file was loaded and parsed properly (meaning the new key code was recognized) but the mapping just doesn't work.

Unicode for this character is U+0160 and U+0161. Here is the Wikipedia entry.

Any ideas?

EDIT: Solved for iTerm2 by adding a keyboard shortcut in iTerm2's preferences.

share|improve this question

2 Answers 2

Did you try the text substitution option in System Preferences?

  1. Go to System Preferences
  2. Go to the "Language & Text" pane, click on the "Text" pane (or simply search for substitution to go directly to that pane)
  3. Make sure that "Use symbol and text substitution" is enabled.
  4. Click the "+" icon at the bottom of the list of substitutions.
  5. Add a new entry. I used "Eliska" in the replace column and "Eliška" in the "with" column.

The substitution worked for me in TextEdit, but not in this text entry window. It also seemed to be ignored in Excel. It'll probably work better in apps which use Apple frameworks and use rich text (not plain ascii).

share|improve this answer
    
Yes, I did try that and it worked fine for me in TextEdit just as you say. It really needs to work everywhere though. Thanks –  Honza Pokorny Jan 30 '13 at 18:05

You can also use Ukelele to create a custom keyboard layout.

  1. Choose File > New Based on Current Input Source.
  2. Edit the layout and save it as a bundle to /Library/Keyboard Layouts/. Keyboard layouts in the user library aren't selected by default in password dialogs. The popovers shown when holding keys don't work with normal keylayout files.
  3. Log out and back in.
  4. Enable the input source in System Preferences.

To apply changes, you have to log out and back in after for example touching /Library/Keyboard Layouts/.

You can disable the default input sources by removing them from ~/Library/Preferences/ByHost/com.apple.HIToolbox.*.plist and logging out and back in.

TextExpander also works in iTerm and many cross platform applications. I have removed most non-ASCII characters from my custom keyboard layout, because abbreviations like scaron are often easier to remember and configure.

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.