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 am used to using US International as my keyboard layout. However, the implementation appears to differ greatly between Windows and Linux (Gnome, in my case – may well be a GTK issue since GTK behaves the same on Windows).

The layout uses dead keys, for example for keys such as ', ", ^, &c. allowing easy entry of characters with diacritics. On Windows pressing a dead key and then a key that has no pair associated results in the dead key's character (when paired with space) and the character from the second key. Example: Pressing ", a yields “ä”, however, pressing ', s yields “'s”, as there is no pairing for ' and s.

Now, there is a language called English which makes frequent use of exactly those two characters and since it works on Windows to just type them as usual it's muscle memory for me now. Which brings me to my problem:

On Linux (and GTK on Windows), there is a pairing for ' and s (among many others), resulting in ś (which, in turn, leads to me frequently typing “itś”). So typing “it's” requires me to type ',         , s at the end.

There are a few other combinations I'm used to that don't work. Among those is that for non-existant pairs simply nothing is the result. Typing “I'd” results in “I”. Hitting one of those keys twice results in a non-spacing diacritic which breaks my habit of typing strings by first typing both quotation marks (which now result in a non-spacing acute accent or macron).

Long story short: None of the supplied US International layouts appears to function the same as in Windows – are there any that do work identically? Or any chance to configure it that way? While it may be nice to type an s with acute accent or non-spacing diacritics, those aren't exactly common needs for me.

share|improve this question
    
For anyone wondering why I use US International, instead of something else: I'm from Germany and need to type things like ä, ö, ü, ß at times. But most programming language designers design their languages for exactly one layout so people have to resort to finger-breaking key combinations to enter characters such as curly braces or a backslash. –  Joey Jun 19 '10 at 8:33
add comment

2 Answers

One possibility is to avoid having dead keys and type accented letters with a Compose key instead. For example, type Compose " a to enter ä. You'll have to choose a keyboard layout option that includes a Compose key; a common choice is the key to the left of the right Ctrl key (which I think Windows calls Menu). The advantage of Compose is that you get to be able to type many fancy characters without changing your main layout. The disadvantage is that it takes three presses instead of two for an accented letter.

Alternatively, you can configure the effect of dead keys by creating a file called .XCompose (note CApitalization) in your home directory and listing the combinations you want. Something like:

include "/usr/share/X11/locale/en_US.UTF-8/Compose"

<dead_acute> <space> : "'" apostrophe
<dead_acute> <exclam> : "'!"
<dead_acute> <quotedbl> : "'\""
# etc...
<dead_acute> <a> : "á"
<dead_acute> <b> : "'b"
# etc...

The syntax is fairly simple: the sequence of keys to the left of the : is turned into the string between "" on the right of the :. The extra word on the right is the keysym (i.e., the name of the key) corresponding to this sequence of keys; it's not terribly important. Anything from a # to the end of the line is ignored.

Change the first line to point to the system file if your distribution puts it in a different place. You can look in this file for more syntax examples. <Multi_key> is another name for the Compose key.

On the left, the names between <angle brackets> are keysyms. You can find the list of keysyms in /usr/include/X11/keysymdef.h (this file is in a development package, e.g., x11proto-core-dev on Ubuntu).

Yes, that's a lot of typing, but you should be able to automate much of it by copy-pasting chunks of keysymdef.h and doing a few clever mass replacements. Something that will help is that you can reuse the hexadecimal code on the right to make the right-hand string thanks to the "\xdd" syntax: turn e.g.

#define XK_exclam                        0x0021  /* U+0021 EXCLAMATION MARK */

into

<dead_acute> <exclam> : "'\x21"

Finally, you can set up a keyboard layout with dead keys and a Compose key. Being German, you might set up only " as a dead key. If you're going that route, the simplest option is to use the GUI to set up a keyboard with no dead key and an .Xmodmap file for the dead key, containing something like

keysym apostrophe = apostrophe dead_quotedbl
share|improve this answer
    
Ok, I'll look into it (not at the other machine right now). Using Compose isn't an option since I would have to re-learn muscle memory and Linux isn't my main system anyway. And don't assume that just because I'm German I won't ever need anything beyond umlauts ;-). There are quite many words imported from other languages that use a grave or acute accent as well. –  Joey Jul 10 '10 at 9:22
    
It would probably be better to start out with just override exactly those combinations with which you have trouble, and add to the table when you find new things that bug you, i.e. <dead_acute> <s> : "'s" –  RolKau Nov 23 '10 at 0:36
    
You also may have to set GTK_IM_MODULE=xim to use the compose sequences defined in ~/.XCompose, and not the GTK built-ins (!). –  RolKau Nov 23 '10 at 0:39
add comment

I'm aware this question has been "solved" for a while. However, I want to present my solution, which combines the findings from this page with a lot of testing and experimentation.

Win US Intl for Linux is a series of scripts I wrote to solve the issue of having problems with the Linux's native US Intl keyboard layout, just as the OP wrote. I use it mainly because my mother language is Spanish, and I still use lots of English forums, texts, chats and so on (like this site).

To note: This is actually similar (not totally equal) to the behavior of Windows XP US - International keyboard layout.

You can go to http://tamh.info/en/win-us-intl-4-linux/ to check it out. I'm in the process of making it better, by adding more XCompose entries for several other borderline cases, among other changes.

share|improve this answer
add comment

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.