How to use an input language different from the keyboard layout country and from the system language?

  • My system language is set to English and I want it to stay that way
  • My keyboard layout is set to USA intl and I want it to stay that way
  • I can't write ç, by pressing ´+c. When I try to do so it outputs ć
  • In Windows the keyboard layout country can be different from both system and input languages, which in their turn can be different from each other.
  • I want to achieve the same with Ubuntu

Keyboard layouts are not dependent to countries (some countries don't have a keyboard layout, some have multiple, some keyboard-layouts are used in several countries, some keyboard layouts have no relation to any country, etc.).

So just change the keyboard layout to something else (I would suggest "US International with AltGr dead keys", or maybe to something else that you are used to).


Edit: it seems like by default US international behaves differently on Windows than in X; in Windows ' followed by c gives ç, while in X it gives ć.


Edit 2: okay, so I found a solution, but it doesn't work in Gtk/GNOME applications because of a stupid bug...

Create a file ~/.XCompose and put the following lines in it:

include "/usr/share/X11/locale/en_US.UTF-8/Compose"
<dead_acute> <C>        : "Ç" Ccedilla # LATIN CAPITAL LETTER C WITH CEDILLA
<dead_acute> <c>        : "ç" ccedilla # LATIN SMALL LETTER C WITH CEDILLA

Edit 3: Actually it does work in Gtk too when you select XIM as the import method for Gtk, and make sure it's selected in the Language Support dialog.


My keyboard layout is set to USA intl and I want it to stay that way

So, in particular, ' is a dead key, right? (I can't be sure because there are several keyboard layouts that you might have abbreviated “USA intl”. To avoid ambiguities, use the exact full name in your question.)

I can't write ç, by pressing '+c. When I try to do so it outputs ć

That's normal. Acute accent + lowercase C = lowercase C with acute. You picked a “USA intl” keyboard variant, it has no reason to favor the characters used in Portuguese over the characters used in Polish.

(Windows's “USA International” does give you ç for '+C, but that's because their idea of “international” is “some Western European languages, with only latin1 characters”. Since ć is not in the latin1 character set, the combination '+'C' is mapped in a counter-intuitive way to a different character that does exist and is not otherwise accessible.)

If ' is indeed a dead key, you can change the characters it generates to specialize to your favorite language. There's no GUI for that, you have to write a configuration file. Copy /usr/share/X11/locale/en_US.UTF-8/Compose to .XCompose in your home directory. In .XCompose, look for lines that read

<dead_acute> <C> : "Ć"   U0106 # LATIN CAPITAL LETTER C WITH ACUTE
<dead_acute> <c> : "ć"   U0107 # LATIN SMALL LETTER C WITH ACUTE

and replace them by

<dead_acute> <C> : "Ç"   Ccedilla # LATIN CAPITAL LETTER C WITH CEDILLA
<dead_acute> <c> : "ç"   ccedilla # LATIN SMALL LETTER C WITH CEDILLA

If you add another keyboard layout, there will appear a new indicator icon that let's you chose which one you want to be active.

You can have as many as you want and change them on the fly. If you found one that works properly (which "US Alternate International" should do), you can remove all others and the indicator will disappear.


Goto System-->Preferences-->IBus Preferences it will show you a window click yes alt text

After clicking Yes.Another window will be shown like the one you see below alt text

You can change the input method to any language according to your wish and click add.New language will be added now.Now you can type in the selected languages,just press Ctrl+Space to toggle between the languages..For example if you choose Hindi, pressing Ctrl+Space will allow you to type in Hindi if you press Ctrl+Space again you can type in English.

Note:

If you are using ubuntu 10.10 you should install the following

sudo apt-get install ibus ibus-m17n m17n-db m17n-contrib ibus-gtk

To type this ç character.Goto System-->Keyboard-->Layouts and click Options alt text

Check Right Alt and then click close. alt text

Now Hold Right-Alt and then press c+, it will give you ç